\s*([^<]+).*?href="([^"]+)"\s+class="watch',re.DOTALL).findall(result)
+ links = client.parseDOM(result, 'a', attrs={'class':'watch-btn btn btn-success btn-3d'}, ret='href')
+ #print links
+ try:
+ links_src = client.parseDOM(result, 'td')
+ #print links_src
+ links_src2 = [re.findall(r'(.*?) ', i)[0].strip() for i in links_src if 'fa fa-youtube link-logo' in i]
+ except:
+ links_src2 = []
+
+ ii = 0
+ for link in links:
+ try:
+ src = links_src2[ii]
+ except:
+ src = 'unknown'
+
+ ii += 1
+ try:
+ if src.lower() in ['openload','streamango','unknown']:
+ url2 = urlparse.urljoin(self.base_link, link)
+ for i in range(5):
+ result2 = client.request(url2, timeout=7)
+ if result2 == None or str(result2) == '502':
+ log('FAIL', 'get_sources','result error, trying again', dolog=self.init)
+ time.sleep(7)
+ if not result2 == None and str(result2) != '502': break
+
+ r = re.compile('href="([^"]+)"\s+class="action-btn').findall(result2)[0]
+
+ l = resolvers.createMeta(r, self.name, self.logo, quality, [], key, poster=poster, riptype=riptype, vidtype=vidtype, sub_url=sub_url, testing=testing, page_url=page_url)
+ for ll in l:
+ if ll != None and 'key' in ll.keys():
+ links_m.append(ll)
+
+ except:
+ pass
+
+ for l in links_m:
+ if l != None and 'key' in l.keys():
+ sources.append(l)
+
+ if len(sources) == 0:
+ log('FAIL','get_sources','Could not find a matching title: %s' % cleantitle.title_from_key(key))
+ else:
+ log('SUCCESS', 'get_sources','%s sources : %s' % (cleantitle.title_from_key(key), len(sources)))
+
+ log('INFO', 'get_sources', 'Completed')
+
+ return sources
+ except Exception as e:
+ log('ERROR', 'get_sources', '%s' % e)
+ log('INFO', 'get_sources', 'Completed')
+ return sources
+
+ def resolve(self, url):
+ try:
+ return url
+ except:
+ return
+
+def log(type='INFO', method='undefined', err='', dolog=True, logToControl=False, doPrint=True):
+ try:
+ msg = '%s: %s > %s > %s : %s' % (time.ctime(time.time()), type, name, method, err)
+ if dolog == True:
+ loggertxt.append(msg)
+ if logToControl == True:
+ control.log(msg)
+ if control.doPrint == True and doPrint == True:
+ print msg
+ except Exception as e:
+ control.log('Error in Logging: %s >>> %s' % (msg,e))
|