def get_source(self,url,title,year,season,episode,start_time):
        try:
            headers = {'User-Agent': client.agent()}
            OPEN = client.request(url, headers=headers)
            holder = client.parseDOM(OPEN, 'div', attrs={'class':'bwa-content'})[0]
            holder = client.parseDOM(holder, 'a', ret='href')[0]
            links = client.request(holder, headers=headers)
            Regex = client.parseDOM(links, 'iframe', ret='src', attrs={'class': 'metaframe rptss'})
            count = 0
            for link in Regex:
                if 'player.php' in link:
                    link = client.request(link, headers=headers, output='geturl')
                    qual = client.request(link, headers=headers)
                    qual = client.parseDOM(qual, 'meta', ret='content')[0]
                else:
                    link = link

                host = link.split('//')[1].replace('www.','')
                host = host.split('/')[0].split('.')[0].title()

                if '1080p' in qual:
                    rez = '1080p'
                elif '720p' in qual:
                    rez = '720p'
                else: rez = 'SD'
                count += 1
                self.sources.append({'source': host, 'quality': rez, 'scraper': self.name, 'url': link, 'direct': False})
            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name, end_time, count, title, year, season=season, episode=episode)
        except:
            pass

#movie4u().scrape_movie('Wonder Woman', '2017','')
#movie4u().scrape_episode('Suits','2011','','8','5','','')
Esempio n. 2
0
 def scrape_movie(self, title, year, imdb, debrid=False):
     try:
         count = 0
         start_time = time.time()
         search_id = urllib.quote_plus('%s %s' % (clean_search(title), year))
         start_url = '%s/?s=%s' % (self.base_link, search_id)
         html = client.request(start_url, referer=self.base_link)
         match = re.compile('class="thumb".+?title="(.+?)".+?href="(.+?)">', re.DOTALL).findall(html)
         for name, item_url in match:
             if not year in name:
                 continue
             if not clean_title(title) == clean_title((name.split(year)[0][:-1])):
                 continue
             OPEN = client.request(item_url, referer=self.base_link)
             link = client.parseDOM(OPEN, 'iframe', ret='src')[0]
             host = link.split('//')[1].replace('www.', '')
             host = host.split('/')[0]
             if not filter_host(host):
                 continue
             count += 1
             self.sources.append({'source': host, 'quality': 'HD', 'scraper': self.name, 'url': link, 'direct': False})
         if dev_log == 'true':
             end_time = time.time() - start_time
             send_log(self.name, end_time, count, title, year)
         return self.sources
     except Exception, argument:
         if dev_log == 'true':
             error_log(self.name, argument)
         return self.sources
Esempio n. 3
0
 def scrape_movie(self, title, year, imdb, debrid=False):
     try:
         start_time = time.time()
         scrape = urllib.quote_plus(clean_search(title))
         start_url = '%s/search.html?keyword=%s' % (self.base_link, scrape)
         html = client.request(start_url)
         thumbs = re.compile('<ul class="listing items">(.+?)</ul> ',
                             re.DOTALL).findall(html)
         thumb = re.compile('href="(.+?)".+?alt="(.+?)"',
                            re.DOTALL).findall(str(thumbs))
         for link, link_title in thumb:
             if clean_title(title).lower() == clean_title(
                     link_title).lower():
                 page_link = urlparse.urljoin(self.base_link, link)
                 holdpage = client.request(page_link)
                 datecheck = re.compile('<span>Release: </span>(.+?)</li>',
                                        re.DOTALL).findall(holdpage)[0]
                 if year in datecheck:
                     movie_link = re.compile(
                         '<li class="child_episode".+?href="(.+?)"',
                         re.DOTALL).findall(holdpage)[0]
                     movie_link = urlparse.urljoin(self.base_link,
                                                   movie_link)
                     self.get_source(movie_link, title, year, '', '',
                                     start_time)
                 else:
                     pass
         return self.sources
     except Exception, argument:
         if dev_log == 'true':
             error_log(self.name, argument)
         return self.sources
Esempio n. 4
0
 def scrape_movie(self, title, year, imdb, debrid=False):
     if int(year) > 1980:
         return self.sources
     try:
         start_time = time.time()
         query = urllib.quote_plus(clean_search(title.lower()))
         start_url = urlparse.urljoin(self.base_link, self.search_link % query)
         headers = {'User-Agent': client.agent(), 'Referer': self.base_link}
         count = 0
         html = client.request(start_url, headers=headers)
         posts = client.parseDOM(html, 'div',  attrs={'class': 'post'})
         posts = [(dom_parser.parse_dom(i, 'a', req='href')[0]) for i in posts if i]
         posts = [(i.attrs['href'], i.content) for i in posts if i]
         post = [(i[0]) for i in posts if clean_title(i[1]) == clean_title(title)][0]
         r = client.request(post, headers=headers)
         y = client.parseDOM(r, 'h1')[0]
         if not year in y:
             return self.sources
         links = client.parseDOM(r, 'source', ret='src')
         link = [i for i in links if i.endswith('mp4')][0]
         link += '|User-Agent=%s&Referer=%s' % (client.agent(), post)
         link = urllib.quote(link, ':/-_|&+=')
         count += 1
         self.sources.append({'source': 'bnw', 'quality': 'SD', 'scraper': self.name, 'url': link, 'direct': True})
         if dev_log == 'true':
             end_time = time.time() - start_time
             send_log(self.name,end_time,count,title,year)
         return self.sources
     except Exception, argument:
         if dev_log == 'true':
             error_log(self.name,argument)
         return self.sources
Esempio n. 5
0
 def scrape_episode(self,
                    title,
                    show_year,
                    year,
                    season,
                    episode,
                    imdb,
                    tvdb,
                    debrid=False):
     try:
         start_time = time.time()
         scrape = clean_search(title.lower())
         start_url = urlparse.urljoin(
             self.base_link,
             self.search_link % urllib.quote_plus(clean_search(title)))
         html = client.request(start_url)
         data = json.loads(html)
         posts = data['series']
         post = [
             i['seo_name'] for i in posts
             if clean_title(title) == clean_title(i['original_name'])
         ][0]
         show_page = self.base_link + post
         r = client.request(show_page)
         sepi = 'season-%s-episode-%s' % (int(season), int(episode))
         epi_link = client.parseDOM(r, 'a', ret='href')
         epi_link = [i for i in epi_link if sepi in i][0]
         self.get_sources(epi_link, title, year, season, episode,
                          start_time)
         return self.sources
     except Exception, argument:
         if dev_log == 'true':
             error_log(self.name, argument)
         return self.sources
Esempio n. 6
0
    def scrape_episode(self, title, show_year, year, season, episode, imdb, tvdb, debrid = False):
        try:
            start_time = time.time()
            scrape = urllib.quote_plus(clean_search(title))
            start_url = '%s/search.html?keyword=%s' %(self.base_link, scrape)
            #print 'SEARCH  > '+start_url

            html = client.request(start_url)
            thumbs = re.compile('<ul class="listing items">(.+?)</ul> ',re.DOTALL).findall(html)
            thumb = re.compile('href="(.+?)".+?alt="(.+?)"',re.DOTALL).findall(str(thumbs))  
            for link, link_title in thumb:
                if clean_title(title) in clean_title(link_title):
                    season_chk = '-season-%s' %season
                    #print 'season chk% '+season_chk
                    if not season_chk in link: continue
                    page_link = urlparse.urljoin(self.base_link, link)
                    #print 'page_link:::::::::::::: '+page_link

                    holdpage = client.request(page_link)
                    series_links = re.compile('<li class="child_episode".+?href="(.+?)"',re.DOTALL).findall(holdpage)
                    for movie_link in series_links:
                        episode_chk = '-episode-%sBOLLOX' %episode
                        spoof_link = movie_link + 'BOLLOX'
                        if episode_chk in spoof_link:
                            movie_link = urlparse.urljoin(self.base_link, movie_link)
                            #print 'pass TWS episode check: '+movie_link
                            self.get_source(movie_link,title,year,season,episode,start_time)
                    else:pass
            return self.sources
        except Exception, argument:        
            if dev_log == 'true':
                error_log(self.name,argument)
Esempio n. 7
0
    def scrape_episode(self,title, show_year, year, season, episode, imdb, tvdb, debrid = False):
        try:
            start_time = time.time()
            seaepi_chk = '%sx%s' %(season,episode)
            search_id = urllib.quote_plus(title)
            start_url = '%s/search/%s' % (self.base_link, urllib.quote_plus(search_id)) 
            headers={'User-Agent': client.agent()}
            r = client.request(start_url, headers=headers)
            match = re.compile('class="result-item".+?<a href="(.+?)".+?alt="(.+?)"',re.DOTALL).findall(r)
            #print match
            for link, name in match:
                #print link+'@@@@@@@@'
                #print name+'@@@@@@@@'
                headers={'User-Agent': client.agent()}
                r = client.request(link, headers=headers)
                nextpg= re.compile("class='episodiotitle'><a href='(.+?)'",re.DOTALL).findall(r)
                for url in nextpg:
                    #print url+'>>>>>>>>>>'
                    if seaepi_chk in url:
                        #print url + '<<<<<<<<<<<'

                        self.get_source(url, title, year, season, episode, start_time)
            return self.sources
        except Exception, argument:        
            if dev_log == 'true':
                error_log(self.name,argument)
            return self.sources
Esempio n. 8
0
 def get_source(self,url,title,year,season,episode,start_time):
     try:
         #print 'URL PASSED OK'+url
         count = 0
         headers = {'User-Agent': client.agent()}
         r = client.request(url, headers=headers)
         Endlinks=re.compile("<tr id=.+?a href='(.+?)'.+?class='quality'>(.+?) BR<",re.DOTALL).findall(r)
         #print 'scraperchk - scrape_movie - EndLinks: '+str(Endlinks)
         for link1,qual in Endlinks:
             #link1=link1.replace('#038;','&')
             #print link1+qual+">>>>>>>>>>"
             headers = {'User-Agent': client.agent()}
             r = client.request(link1, headers=headers)
             #print r
             Endlinks1=re.compile('id="link".+?href="(.+?)"',re.DOTALL).findall(r)
             for link in Endlinks1:
                 #print 'scraperchk - scrape_movie - link: '+str(link)
                 count+=1
                 host = link.split('//')[1].replace('www.','')
                 host = host.split('/')[0].split('.')[0].title()
                 self.sources.append({'source':host, 'quality':qual, 'scraper':self.name, 'url':link, 'direct':False})
         if dev_log=='true':
             end_time = time.time() - start_time
             send_log(self.name,end_time,count,title,year)
     except Exception, argument:
         if dev_log=='true':
             error_log(self.name,argument)
         return[]
Esempio n. 9
0
    def get_source(self,url,title,year,season,episode,start_time):
        try:
            headers = {'User-Agent': client.agent()}
            OPEN = client.request(url, headers=headers)
            holder = client.parseDOM(OPEN, 'div', attrs={'class':'bwa-content'})[0]
            holder = client.parseDOM(holder, 'a', ret='href')[0]
            links = client.request(holder, headers=headers)
            Regex = client.parseDOM(links, 'iframe', ret='src', attrs={'class': 'metaframe rptss'})
            count = 0
            for link in Regex:
                if 'player.php' in link:
                    link = client.request(link, headers=headers, output='geturl')
                    qual = client.request(link, headers=headers)
                    qual = client.parseDOM(qual, 'meta', ret='content')[0]
                else:
                    link = link

                host = link.split('//')[1].replace('www.','')
                host = host.split('/')[0].split('.')[0].title()

                if '1080p' in qual:
                    rez = '1080p'
                elif '720p' in qual:
                    rez = '720p'
                else: rez = 'SD'
                count += 1
                self.sources.append({'source': host, 'quality': rez, 'scraper': self.name, 'url': link, 'direct': False})
            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name, end_time, count, title, year, season=season, episode=episode)
        except:
            pass

#movie4u().scrape_movie('Wonder Woman', '2017','')
#movie4u().scrape_episode('Suits','2011','','8','5','','')
Esempio n. 10
0
    def scrape_movie(self, title, year, imdb, debrid=False):
        if int(year) > 1980: return self.sources
        try:
            start_time = time.time()
            query = urllib.quote_plus(clean_search(title.lower()))
            start_url = urlparse.urljoin(self.base_link, self.search_link % query)

            headers = {'User-Agent': client.agent(), 'Referer': self.base_link}
            count = 0
            html = client.request(start_url, headers=headers)
            posts = client.parseDOM(html, 'div',  attrs={'class': 'post'})
            posts = [(dom_parser.parse_dom(i, 'a', req='href')[0]) for i in posts if i]
            posts = [(i.attrs['href'], i.content) for i in posts if i]
            post = [(i[0]) for i in posts if clean_title(i[1]) == clean_title(title)][0]
            r = client.request(post, headers=headers)

            y = client.parseDOM(r, 'h1')[0]
            if not year in y: return self.sources

            links = client.parseDOM(r, 'source', ret='src')
            link = [i for i in links if i.endswith('mp4')][0]
            link += '|User-Agent=%s&Referer=%s' % (client.agent(), post)
            link = urllib.quote(link, ':/-_|&+=')
            count += 1
            self.sources.append({'source': 'bnw', 'quality': 'SD', 'scraper': self.name, 'url': link, 'direct': True})
            if dev_log=='true':
                end_time = time.time() - start_time
                send_log(self.name,end_time,count,title,year)

            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name,argument)
            return self.sources
Esempio n. 11
0
    def get_source(self,item_url,title,year,start_time):
        try:
            #print 'PASSEDURL >>>>>>'+item_url
            count = 0
            headers = {'User-Agent': client.agent()}
            OPEN = client.request(item_url, headers=headers)
            frame = client.parseDOM(OPEN, 'iframe', ret='src')[0]
            data = client.request(frame, headers=headers)
            data = client.parseDOM(data, 'ul', attrs={'class': 'menuPlayer'})[0]
            links = client.parseDOM(data, 'a', ret='href')

            for link in links:
                #print link+'<<<<<<<<<<<<<<<<<<<<<<<<<<'
                qual = quality_tags.check_sd_url(link)
                if qual == 'SD' and 'openload' in link:
                    data = client.request(link, headers=headers)
                    data = client.parseDOM(data, 'meta', ret='content')[0]
                    qual2, info = quality_tags.get_release_quality(data, None)
                else:
                    qual2 = qual
                count += 1
                host = link.split('//')[1].replace('www.','')
                host = host.split('/')[0].split('.')[0].title()
                self.sources.append({'source':host, 'quality':qual2, 'scraper': self.name, 'url':link, 'direct':False})
            if dev_log=='true':
                end_time = time.time() - start_time
                send_log(self.name,end_time,count,title,year)
        except Exception, argument:
            if dev_log=='true':
                error_log(self.name, argument)


#hdvix().scrape_movie('Black Panther', '2018', 'tt1825683', False)
Esempio n. 12
0
    def get_sources(self, url, title, year, season, episode, start_time):
        try:
            count = 0
            url = urlparse.urljoin(self.base_link,
                                   url) if url.startswith('/') else url

            r = client.request(url)
            data = re.findall(r'\s*(eval.+?)\s*</script', r, re.DOTALL)[1]
            data = jsunpack.unpack(data).replace('\\', '')

            # https://www.primewire.ink/ajax-78583.php?slug=watch-2809620-Black-Panther&cp=7TYP4N
            # var rtv=\'aja\';var aa=\'x-7\';var ba=\'85\';var ca=\'83\';var da=\'.ph\';var ea=\'p?sl\';var fa=\'ug=\';var ia=\'&cp=7T\';var ja=\'YP\';var ka=\'4N\';var code=ia+ja+ka;var page=rtv+aa+ba+ca+da+ea+fa;function goml(loc){$(\'#div1\').load(domain+page+loc+code)}
            patern = '''rtv='(.+?)';var aa='(.+?)';var ba='(.+?)';var ca='(.+?)';var da='(.+?)';var ea='(.+?)';var fa='(.+?)';var ia='(.+?)';var ja='(.+?)';var ka='(.+?)';'''
            links_url = re.findall(patern, data, re.DOTALL)[0]
            slug = 'slug={}'.format(url.split('/')[-1])
            links_url = self.base_link + [''.join(links_url)][0].replace(
                'slug=', slug)
            links = client.request(links_url)
            links = client.parseDOM(links, 'tbody')

            #xbmc.log('@#@LINKSSSS: %s' % links, xbmc.LOGNOTICE)
            for link in links:
                try:
                    data = [(client.parseDOM(link, 'a', ret='href')[0],
                             client.parseDOM(link,
                                             'span',
                                             attrs={'class':
                                                    'version_host'})[0])][0]
                    link = urlparse.urljoin(self.base_link, data[0])

                    host = data[1]

                    if not filter_host(host): continue

                    self.sources.append({
                        'source': host,
                        'quality': 'SD',
                        'scraper': self.name,
                        'url': link,
                        'direct': False
                    })
                except:
                    pass
            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name,
                         end_time,
                         count,
                         title,
                         year,
                         season=season,
                         episode=episode)

        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return self.sources
    def get_source(self, link, title, year, season, episode, start_time):
        try:
            html = client.request(link)
            match = re.compile('var link_server.+?"(.+?)"',
                               re.DOTALL).findall(html)
            count = 0
            for link in match:
                if not link.startswith('https:'):
                    link = 'http:' + link
                if 'vidnode' in link:
                    if not 'load.php' in link:
                        continue
                    #print 'vidnodelink >>> '+link
                    html = client.request(link)

                    grab = re.compile("sources.+?file: '(.+?)',label: '(.+?)'",
                                      re.DOTALL).findall(html)
                    for end_link, rez in grab:
                        if '1080' in rez:
                            res = '1080p'
                        elif '720' in rez:
                            res = '720p'
                        else:
                            res = 'SD'
                        count += 1
                        self.sources.append({
                            'source': 'Vidnode',
                            'quality': res,
                            'scraper': self.name,
                            'url': end_link,
                            'direct': False
                        })

                else:
                    host = link.split('//')[1].replace('www.', '')
                    host = host.split('/')[0]
                    if not filter_host(host): continue
                    count += 1
                    self.sources.append({
                        'source': host,
                        'quality': 'SD',
                        'scraper': self.name,
                        'url': link,
                        'direct': False
                    })
            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name,
                         end_time,
                         count,
                         title,
                         year,
                         season=season,
                         episode=episode)

        except:
            pass
Esempio n. 14
0
    def get_source(self, item_url, title, year, start_time):
        try:
            #print 'PASSEDURL >>>>>>'+item_url
            count = 0
            headers = {'User-Agent': client.agent()}
            OPEN = client.request(item_url, headers=headers)
            #print OPEN
            Endlinks = dom_parser.parse_dom(OPEN, 'a', req='player-data')

            Endlinks = [(i.attrs['player-data'], i.content) for i in Endlinks
                        if i]
            if 'Season' in year:
                Endlinks = [(i[0], 'SD') for i in Endlinks if i[1] in year]
            else:
                Endlinks = [(i[0], i[1]) for i in Endlinks if i]

            #print 'series8 - scrape_movie - EndLinks: '+str(Endlinks)
            for link, quality in Endlinks:
                qual = quality_tags.check_sd_url(quality)

                if 'vidcloud' in link:
                    link = 'https:' + link if link.startswith('//') else link
                    data = client.request(link, headers=headers)
                    link = re.findall(
                        '''file\s*:\s*['"](.+?)['"].+?type['"]\s*:\s*['"](.+?)['"]''',
                        data, re.DOTALL)[0]
                    host = link[1]
                    link = link[
                        0] + '|User-Agent=%s&Referer=https://vidcloud.icu/' % urllib.quote(
                            client.agent())
                    direct = True
                else:
                    host = link.split('//')[1].replace('www.', '')
                    host = host.split('/')[0].split('.')[0].title()
                    direct = False

                count += 1
                self.sources.append({
                    'source': host,
                    'quality': qual,
                    'scraper': self.name,
                    'url': link,
                    'direct': direct
                })

            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name, end_time, count, title, year)
            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return self.sources


#seriesonline8().scrape_movie('Black Panther', '2018', 'tt1825683', False)
#seriesonline8().scrape_episode('Suits','2011','','8','5','','')
Esempio n. 15
0
 def get_source(self, media_url, title, year, season, episode, start_time):
     season_bollox = "0%s" % season if len(season) < 2 else season
     episode_bollox = "0%s" % episode if len(episode) < 2 else episode
     all_bollox = 's%se%s' % (season_bollox, episode_bollox)
     try:
         headers = {'User-Agent': client.agent()}
         html = client.request(media_url, headers=headers)
         match = re.findall(r'<li><a href="([^"]+)">([^<>]*)<span.+?>',
                            str(html), re.I | re.DOTALL)
         count = 0
         for media_url, media_title in match:
             if all_bollox in media_title.lower():
                 link = client.request(media_url, headers=headers)
                 frame = client.parseDOM(link, 'iframe', ret='src')
                 for frame_link in frame:
                     self.sources.append({
                         'source': 'Openload',
                         'quality': 'Unknown',
                         'scraper': self.name,
                         'url': frame_link,
                         'direct': False
                     })
                 cool_links = re.compile(
                     '"dwn-box".+?ref="(.+?)" rel="nofollow">(.+?)<span',
                     re.DOTALL).findall(link)
                 for vid_url, res in cool_links:
                     if '1080' in res:
                         res = '1080p'
                     elif '720' in res:
                         res = '720p'
                     elif 'HD' in res:
                         res = 'HD'
                     else:
                         res = 'SD'
                     count += 1
                     vid_url += '|User-Agent=%s&Referer=%s' % (
                         client.agent(), media_url)
                     vid_url = urllib.quote(vid_url, '|:?/&+=_-')
                     self.sources.append({
                         'source': 'Direct',
                         'quality': res,
                         'scraper': self.name,
                         'url': vid_url,
                         'direct': True
                     })
         if dev_log == 'true':
             end_time = time.time() - start_time
             send_log(self.name,
                      end_time,
                      count,
                      title,
                      year,
                      season='',
                      episode='')
     except:
         pass
    def get_source(self, item_url, title, year, season, episode, start_time):
        try:
            #print 'coolmovies pass ' + item_url
            headers = {'User-Agent': client.agent()}
            r = client.request(item_url, headers=headers)
            #xbmc.log('@#@HTML:%s' % r, xbmc.LOGNOTICE)

            data = client.parseDOM(r, 'table', attrs={'class':
                                                      'source-links'})[0]
            data = client.parseDOM(data, 'tr')
            data = [(client.parseDOM(i, 'a',
                                     ret='href')[0], client.parseDOM(i,
                                                                     'td')[1])
                    for i in data if 'version' in i.lower()]  #Watch Version
            Endlinks = [(i[0], re.sub('<.+?>', '', i[1])) for i in data if i]

            #Endlinks = re.compile('<td align="center"><strong><a href="(.+?)"',re.DOTALL).findall(r)
            #print 'coolmoviezone - scrape_movie - EndLinks: '+str(Endlinks)
            count = 0
            for link, host in Endlinks:
                if 'filebebo' in host: continue  #host with captcha
                if 'fruitad' in host:
                    link = client.request(link)
                    link = client.parseDOM(
                        link, 'meta', attrs={'name': 'og:url'},
                        ret='content')[0]  #returns the real url
                    if not link: continue

                import resolveurl
                if resolveurl.HostedMediaFile(link):
                    from universalscrapers.modules import quality_tags
                    quality, info = quality_tags.get_release_quality(
                        link, link)
                    if quality == 'SD':
                        quality = 'DVD'
                    host = host.split('/')[0].split('.')[0].title()
                    count += 1
                    self.sources.append({
                        'source': host,
                        'quality': quality,
                        'scraper': self.name,
                        'url': link,
                        'direct': False
                    })
            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name,
                         end_time,
                         count,
                         title,
                         year,
                         season='',
                         episode='')
        except:
            pass
Esempio n. 17
0
    def scrape_movie(self, title, year, imdb, debrid=False):
        try:
            start_time = time.time()
            search_id = clean_search(title.lower())
            #print search_id
            #xbmc.log('@#@TITLE: %s' % search_id, xbmc.LOGNOTICE)
            start_url = urlparse.urljoin(self.base_link, self.search_link % urllib.quote_plus(search_id))
            headers = {'User-Agent': client.agent()}

            r = client.request(start_url, headers=headers)
            posts = client.parseDOM(r, 'div', attrs={'id': 'movie-\d+'})
            posts = [(client.parseDOM(i, 'h4')[0]) for i in posts if i]
            #print posts
            posts = [(client.parseDOM(i, 'a', ret='href')[0],
                      client.parseDOM(i, 'a')[0]) for i in posts if i]

            #posts = [(i[0]) for i in posts if clean_title(search_id) == clean_title(i[1])]
            count = 0
            for link, found_title in posts:
                link = urlparse.urljoin(self.base_link, link) if link.startswith('/') else link
                if not clean_title(title) == clean_title(found_title): continue
                result = client.request(link, headers=headers)
                y = client.parseDOM(result, 'div', attrs={'class': 'showValue showValueRelease'})[0]
                if not year == y: continue

                streams = client.parseDOM(result, 'div', attrs={'class': 'linkTr'})
                for stream in streams:
                    quality = client.parseDOM(stream, 'div', attrs={'class': 'linkQualityText'})[0]
                    link = client.parseDOM(stream, 'div', attrs={'class':'linkHidden linkHiddenUrl'})[0]
                    #print link

                    if 'vidnode' in link:
                        continue

                    if 'HD' in quality:
                        quality = 'HD'
                    else:
                        quality = 'SD'

                    host = quality_tags._give_host(link)
                    #print host
                    count += 1
                    self.sources.append(
                        {'source': host, 'quality': quality, 'scraper': self.name, 'url': link, 'direct': False})
            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name, end_time, count, title, year)
            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return self.sources
Esempio n. 18
0
    def resolve(self, link):
        try:
            if 'player.php' in link:
                url = client.request(link, output='geturl')
                return url
            elif '/redirect/' in link:
                url = client.request(link, output='geturl')
                return url
        except:
            return link


#movienolimit().scrape_movie('Venom', '2018', '')
Esempio n. 19
0
    def resolve(self, url):
        try:
            #print 'passed'
            urldata = urlparse.parse_qs(url)
            #print urldata
            urldata = dict((i, urldata[i][0]) for i in urldata)
            #print urldata

            post = {
                'ipplugins': 1,
                'ip_film': urldata['data-film'],
                'ip_server': urldata['data-server'],
                'ip_name': urldata['data-name'],
                'fix': "0"
            }
            #print post
            p1 = client.request(
                'http://m4ufree.net/ip.file/swf/plugins/ipplugins.php',
                post=post,
                referer=urldata['url'],
                XHR=True)
            p1 = json.loads(p1)
            #print p1
            p2 = client.request(
                'http://m4ufree.net/ip.file/swf/ipplayer/ipplayer.php?u=%s&s=%s&n=0'
                % (p1['s'], urldata['data-server']))
            p2 = json.loads(p2)
            #print p2
            # p3 = client.request('http://m4ufree.net/ip.file/swf/ipplayer/api.php?hash=%s' %(p2['hash']))
            # print p3
            # p3 = json.loads(p3)
            # print p3
            # n = p3['status']
            # print n
            # if not n :
            #     p2 = client.request('http://m4ufree.net/ip.file/swf/ipplayer/ipplayer.php?u=%s&s=%s&n=1' %(p1['s'],urldata['data-server']))
            #     p2 = json.loads(p2)
            u = p2["data"]
            if not u.startswith('https:'):
                url = "https:%s" % u.replace("\/", "/")
            else:
                url = u
            #print url
            return url
        except:
            return


#m4ufree().scrape_movie('deadpool 2','2018','')
Esempio n. 20
0
    def scrape_episode(self, title, show_year, year, season, episode, imdb, tvdb, debrid=False):
        try:
            start_time = time.time()
            hdlr = 'S%02dE%02d' % (int(season), int(episode))
            query = clean_search(title)
            query = urllib.quote_plus(query + ' ' + hdlr)
            urls = []
            for link in self.search_links:
                try:
                    url = urlparse.urljoin(self.base_link, link % query)
                    url = urlparse.urljoin(self.base_link, url)
                    r = client.request(url)
                    posts = client.parseDOM(r, 'tbody')
                    posts = client.parseDOM(posts, 'tr')
                    urls += [(client.parseDOM(i, 'button', ret='data-clipboard-text')[0]) for i in posts if i]
                except:
                    pass
            count = 0
            for url in urls:
                name = url.split('/')[-1].lower()
                name = client.replaceHTMLCodes(name).replace('%20', '')
                if 'movies' in url:
                    continue
                if any(x in url for x in ['italian', 'dubbed', 'teaser', 'subs', 'sub', 'dub',
                                          'samples', 'extras', 'french', 'trailer', 'trailers', 'sample']):
                    continue

                t = re.sub('(\.|\(|\[|\s)(S\d+E\d+|S\d+)(\.|\)|\]|\s)(.+|)', '', name, flags=re.I)
                if clean_title(t) not in clean_title(title): continue
                y = re.findall('[\.|\(|\[|\s](S\d+E\d+|S\d+)[\.|\)|\]|\s]', name, re.I)[-1].upper()
                if not y == hdlr: continue

                res, info = quality_tags.get_release_quality(name, url)

                if any(x in url for x in ['hastidl', '1tehmovies', '62.210.103.107', '79.127', '213.32.113.82',
                                          'dl5.downloadha', '89.163.255.42', '185.56.20.142', 's1.0music',
                                          'dl3.yoozdl', 'dl4.lavinmovie.net', 'dl6.lavinmovie.net',
                                          'dl3.upload08.com', 'dl8.uploadt.com', '163.172.6.218',
                                          'samba.allunix.ru', 'server417']):
                    count += 1

                    url += '|User-Agent=%s&Referer=%s' % (client.agent(), self.base_link)
                    url = urllib.quote(url, '|:?/&+=_-')

                    self.sources.append(
                        {'source': 'DirectLink', 'quality': res, 'scraper': self.name, 'url': url, 'direct': True})

            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name, end_time, count, title, year)

            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return self.sources



#filepursuit().scrape_movie('Black Panther', '2018', '')
Esempio n. 21
0
    def scrape_movie(self, title, year, imdb, debrid=False):
        try:
            start_time = time.time()
            search_id = clean_search(title.lower())
            start_url = '%s/?s=%s' % (self.base_link,
                                      urllib.quote_plus(search_id))
            #print start_url
            headers = {'User-Agent': client.agent()}
            r = client.request(start_url, headers=headers)
            grab = re.compile(
                'class="TPost C".+?<a href="(.+?)">.+?class="Title">(.+?)</div> <span class="Year">(.+?)</span>',
                re.DOTALL).findall(r)
            for url, name, date in grab:
                #print url+'>>>>>>'
                name = name.lower()
                #print name+'<<<<<<<<<<'
                if clean_title(title) == clean_title(name):
                    if date == year:
                        self.get_source(url, title, year, '', '', start_time)

            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return self.sources
Esempio n. 22
0
    def scrape_episode(self,
                       title,
                       show_year,
                       year,
                       season,
                       episode,
                       imdb,
                       tvdb,
                       debrid=False):
        try:
            start_time = time.time()
            if not debrid:
                return []
            season_url = "0%s" % season if len(season) < 2 else season
            episode_url = "0%s" % episode if len(episode) < 2 else episode
            sea_epi = 's%se%s' % (season_url, episode_url)

            start_url = "%s/?s=%s+%s" % (self.base_link, title.replace(
                ' ', '+').lower(), sea_epi)

            OPEN = client.request(start_url)
            content = re.compile('<h2><a href="([^"]+)"',
                                 re.DOTALL).findall(OPEN)
            for url in content:
                if not clean_title(title).lower() in clean_title(url).lower():
                    continue
                self.get_source(url, title, year, season, episode, start_time)
            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return self.sources
    def scrape_episode(self, title, show_year, year, season, episode, imdb, tvdb, debrid = False):
        try:
            start_time = time.time()
            search_id = clean_search(title.lower())
            start_url = '%s/?s=%s+season+%s' % (self.base_link, urllib.quote_plus(search_id), season)
            headers = {'User_Agent': client.agent()}
            html = client.request(start_url, headers=headers)
            #print 'PAGE>>>>>>>>>>>>>>>>>'+html
            posts = client.parseDOM(html, 'div', attrs={'class': 'result-item'})
            posts = [(client.parseDOM(i, 'div', attrs={'class': 'details'})[0]) for i in posts if i]
            posts = [i for i in posts if not 'SEO Checker' in i]
            for post in posts:
                try:
                    name = client.parseDOM(post, 'a')[0]
                    name = re.sub('<.+?>', '', name)
                    url = client.parseDOM(post, 'a', ret='href')[0]
                except:
                    raise Exception()
                tit = re.sub('(\.|\(|\[|\s)(Season)(\.|\)|\]|\s|)(.+|)', '', name, flags=re.I)
                if not clean_title(title).lower() == clean_title(tit).lower():
                    continue

                epi_id = '%sx%s/' % (season, episode)
                ep_link = url.replace('/seasons/', '/episodes/')
                ep_link = ep_link.split('-season')[0] + '-%s' % epi_id

                self.get_source(ep_link, title, year, season, episode, start_time)
                
            #print self.sources
            return self.sources
        except Exception, argument:        
            if dev_log == 'true':
                error_log(self.name,argument)
            return self.sources
Esempio n. 24
0
 def scrape_movie(self, title, year, imdb, debrid = False):
     try:
         start_time = time.time()                                                   
         search_id = clean_search(title.lower())                                      
                                                                                     
         start_url = '%s/search?query=%s' % (self.base_link, urllib.quote_plus(search_id))
         #print 'scraperchk - scrape_movie - start_url:  ' + start_url
         headers = {'User-Agent': client.agent()}
         html = client.request(start_url, headers=headers)
         #print html           
         match = re.compile('class="movie-item view-tenth".+?href="(.+?)">.+?alt="(.+?)" />.+?data-title="Quality">(.+?)<',re.DOTALL).findall(html)  
         for link, name, qual in match:
             #print item_url1
             item_url = urlparse.urljoin(self.base_link, link)
             qual = qual.replace('&nbsp;','')
             #print 'scraperchk - scrape_movie - name: '+name
             #print 'scraperchk - scrape_movie - item_url: '+item_url
             if clean_title(search_id) == clean_title(name):
                 #print 'scraperchk - scrape_movie - Send this URL: ' + item_url                             
                 self.get_source(item_url, title, year, start_time, qual)
         print self.sources
         return self.sources
     except Exception, argument:
         if dev_log == 'true':
             error_log(self.name,argument)
         return self.sources
Esempio n. 25
0
 def _get_items(self, url):
     items = []
     try:
         headers = {'User-Agent': client.agent()}
         #scraper = cfscrape.create_scraper()
         #r = scraper.get(url, headers=headers) 
         r= client.request(url, headers=headers)
         #print r
         posts = client.parseDOM(r, 'tr', attrs={'name': 'hover'})
         for post in posts:
             data = dom.parse_dom(post, 'a', {'class': 'magnet'}, req=['href', 'title'])[0]
             url = data.attrs['href']
             name = data.attrs['title']
             t = name.split(self.hdlr)[0]
             if not clean_title(re.sub('(|)', '', t)) == clean_title(self.title):
                 continue
             try:
                 y = re.findall('[\.|\(|\[|\s|\_|\-](S\d+E\d+|S\d+)[\.|\)|\]|\s|\_|\-]', name, re.I)[-1].upper()
             except BaseException:
                 y = re.findall('[\.|\(|\[|\s\_|\-](\d{4})[\.|\)|\]|\s\_|\-]', name, re.I)[-1].upper()
             if not y == self.hdlr:
                 continue
             try:
                 size = re.findall('((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', post)[0]
                 div = 1 if size.endswith(('GB', 'GiB')) else 1024
                 size = float(re.sub('[^0-9|/.|/,]', '', size.replace(',', '.'))) / div
                 size = '%.2f GB' % size
             except BaseException:
                 size = '0'
             items.append((name, url, size))
         return items
     except BaseException:
         return items
    def scrape_movie(self, title, year, imdb, debrid = False):
        try:
            start_time = time.time()
            search_id = clean_search(title.lower())
            start_url = '%s/?s=%s' % (self.base_link, urllib.quote_plus(search_id))
            headers = {'User-Agent': client.agent()}
            html = client.request(start_url, headers=headers)
            posts = client.parseDOM(html, 'div', attrs={'class': 'result-item'})
            posts = [(client.parseDOM(i, 'div', attrs={'class': 'details'})[0]) for i in posts if i]
            posts = [i for i in posts if not 'SEO Checker' in i]
            for post in posts:
                try:
                    name = client.parseDOM(post, 'a')[0]
                    url = client.parseDOM(post, 'a', ret='href')[0]
                    date = client.parseDOM(post, 'span', attrs={'class': 'year'})[0]
                except:
                    raise Exception()
                name = re.sub('<.+?>', '', name)
                tit = re.sub('(\.|\(|\[|\s)(\d{4}|S\d+E\d+|S\d+)(\.|\)|\]|\s|)(.+|)', '', name, flags=re.I)

                if not clean_title(title) == clean_title(tit):
                    continue
                if not year == date:
                    continue
                self.get_source(url, title, year, '', '', start_time)
            
            return self.sources
        except Exception, argument:        
            if dev_log == 'true':
                error_log(self.name,argument)
            return self.sources
Esempio n. 27
0
 def get_source(self, start_url, title, year, season, episode, start_time):
     try:
         #print 'URL PASSED OKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK'+start_url
         count = 0
         headers = {'User-Agent': client.agent()}
         r = client.request(start_url, headers=headers)
         #print r
         Endlinks = re.compile(
             'torrent" rel="nofollow".+?img alt="(.+?)".+?href="(.+?)".+?class="is-hidden-touch">(.+?)</td>',
             re.DOTALL).findall(r)
         #print 'scraperchk - scrape_movie - EndLinks: '+str(Endlinks)
         for qual, Magnet, size in Endlinks:
             Magnet = Magnet.replace('%3A',
                                     ':').replace('%3F', '?').replace(
                                         '%3D', '=').split('&dn=')[0]
             print Magnet + '<><><><><>'
             qual = quality_tags.get_release_quality(qual, None)[0]
             count += 1
             self.sources.append({
                 'source': 'Torrent',
                 'quality': qual + ' ' + size,
                 'scraper': self.name,
                 'url': Magnet,
                 'direct': False,
                 'debridonly': True
             })
         if dev_log == 'true':
             end_time = time.time() - start_time
             send_log(self.name, end_time, count, title, year)
     except Exception, argument:
         if dev_log == 'true':
             error_log(self.name, argument)
         return []
Esempio n. 28
0
    def scrape_episode(self, title, show_year, year, season, episode, imdb, tvdb, debrid=False):
        try:
            start_time = time.time()
            season_chk = '-season-%s' %(season)
            #print season_chk
            search_id = clean_search(title.lower())
            start_url = '%s/%s/%s' % (self.base_link, self.search_link, search_id.replace(' ', '-'))
            headers = {'User-Agent': client.agent()}
            html = client.request(start_url, headers=headers, redirect=True)
            match = re.compile('class="ml-item".+?href="(.+?)".+?title="(.+?)"',re.DOTALL).findall(html)
            for season_url, title in match:
                #print season_url
                if not season_chk in season_url:
                    continue
                #print 'PASSED season URL### ' +season_url
                episode_grab = 'Season %s Episode %s ' % (season, episode)

                item_url = 'https://www2.series9.io'+season_url+'/watching.html'

                self.get_source(item_url, title, episode_grab, start_time)

            #print self.sources
            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
Esempio n. 29
0
    def scrape_movie(self, title, year, imdb, debrid=False):
        try:
            start_time = time.time()
            search_id = clean_search(title.lower())

            start_url = '%s/search?query=%s' % (self.base_link,
                                                urllib.quote_plus(search_id))
            #print 'scraperchk - scrape_movie - start_url:  ' + start_url
            headers = {'User-Agent': client.agent()}
            html = client.request(start_url, headers=headers)
            #print html
            match = re.compile(
                'class="movie-item view-tenth".+?href="(.+?)">.+?alt="(.+?)" />.+?data-title="Quality">(.+?)<',
                re.DOTALL).findall(html)
            for link, name, qual in match:
                #print item_url1
                item_url = urlparse.urljoin(self.base_link, link)
                qual = qual.replace('&nbsp;', '')
                #print 'scraperchk - scrape_movie - name: '+name
                #print 'scraperchk - scrape_movie - item_url: '+item_url
                if clean_title(search_id) == clean_title(name):
                    #print 'scraperchk - scrape_movie - Send this URL: ' + item_url
                    self.get_source(item_url, title, year, start_time, qual)
            print self.sources
            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return self.sources
Esempio n. 30
0
    def scrape_movie(self, title, year, imdb, debrid = False):
        try:
            start_time = time.time()
            search_id = clean_search(title.lower())
            start_url = '%s/?s=%s' % (self.base_link, urllib.quote_plus(search_id))
            headers = {'User-Agent': client.agent()}
            html = client.request(start_url, headers=headers)
            posts = client.parseDOM(html, 'div', attrs={'class': 'result-item'})
            posts = [(client.parseDOM(i, 'div', attrs={'class': 'details'})[0]) for i in posts if i]
            posts = [i for i in posts if not 'SEO Checker' in i]
            for post in posts:
                try:
                    name = client.parseDOM(post, 'a')[0]
                    url = client.parseDOM(post, 'a', ret='href')[0]
                    date = client.parseDOM(post, 'span', attrs={'class': 'year'})[0]
                except:
                    raise Exception()
                name = re.sub('<.+?>', '', name)
                tit = re.sub('(\.|\(|\[|\s)(\d{4}|S\d+E\d+|S\d+)(\.|\)|\]|\s|)(.+|)', '', name, flags=re.I)

                if not clean_title(title) == clean_title(tit):
                    continue
                if not year == date:
                    continue
                self.get_source(url, title, year, '', '', start_time)
            
            return self.sources
        except Exception, argument:        
            if dev_log == 'true':
                error_log(self.name,argument)
            return self.sources
Esempio n. 31
0
    def scrape_episode(self, title, show_year, year, season, episode, imdb, tvdb, debrid = False):
        try:
            start_time = time.time()
            search_id = clean_search(title.lower())
            start_url = '%s/?s=%s+season+%s' % (self.base_link, urllib.quote_plus(search_id), season)
            headers = {'User_Agent': client.agent()}
            html = client.request(start_url, headers=headers)
            #print 'PAGE>>>>>>>>>>>>>>>>>'+html
            posts = client.parseDOM(html, 'div', attrs={'class': 'result-item'})
            posts = [(client.parseDOM(i, 'div', attrs={'class': 'details'})[0]) for i in posts if i]
            posts = [i for i in posts if not 'SEO Checker' in i]
            for post in posts:
                try:
                    name = client.parseDOM(post, 'a')[0]
                    name = re.sub('<.+?>', '', name)
                    url = client.parseDOM(post, 'a', ret='href')[0]
                except:
                    raise Exception()
                tit = re.sub('(\.|\(|\[|\s)(Season)(\.|\)|\]|\s|)(.+|)', '', name, flags=re.I)
                if not clean_title(title).lower() == clean_title(tit).lower():
                    continue

                epi_id = '%sx%s/' % (season, episode)
                ep_link = url.replace('/seasons/', '/episodes/')
                ep_link = ep_link.split('-season')[0] + '-%s' % epi_id

                self.get_source(ep_link, title, year, season, episode, start_time)
                
            #print self.sources
            return self.sources
        except Exception, argument:        
            if dev_log == 'true':
                error_log(self.name,argument)
            return self.sources
Esempio n. 32
0
    def get_source(self, item_url, title, year, start_time, qual):
        try:
            #print 'PASSEDURL >>>>>>'+item_url
            count = 0
            headers = {'User-Agent': client.agent()}
            OPEN = client.request(item_url, headers=headers)
            Endlinks = re.compile('<iframe src="(.+?)"',
                                  re.DOTALL).findall(OPEN)
            #print 'scraperchk - scrape_movie - EndLinks: '+str(Endlinks)
            for link in Endlinks:
                #print 'scraperchk - scrape_movie - link: '+str(link)
                count += 1
                host = link.split('//')[1].replace('www.', '')
                host = host.split('/')[0].split('.')[0].title()
                self.sources.append({
                    'source': host,
                    'quality': qual,
                    'scraper': self.name,
                    'url': link,
                    'direct': False
                })
            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name, end_time, count, title, year)
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return self.sources


#movienolimit().scrape_movie('Upgrade', '2018', '')
    def scrape_episode(self, title, show_year, year, season, episode, imdb, tvdb, debrid=False):
        try:
            start_time = time.time()
            season_chk = '-season-%s' %(season)
            #print season_chk
            search_id = clean_search(title.lower())
            start_url = '%s/%s/%s' % (self.base_link, self.search_link, search_id.replace(' ', '-'))
            headers = {'User-Agent': client.agent()}
            html = client.request(start_url, headers=headers, redirect=True)
            match = re.compile('class="ml-item".+?href="(.+?)".+?title="(.+?)"',re.DOTALL).findall(html)
            for season_url, title in match:
                #print season_url
                if not season_chk in season_url:
                    continue
                #print 'PASSED season URL### ' +season_url
                episode_grab = 'Season %s Episode %s ' % (season, episode)

                item_url = 'https://www2.series9.io'+season_url+'/watching.html'

                self.get_source(item_url, title, episode_grab, start_time)

            #print self.sources
            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
Esempio n. 34
0
    def scrape_movie(self, title, year, imdb, debrid=False):
        try:
            start_time = time.time()
            search_id = clean_search(title.lower())

            start_url = '%s/search?query=%s' % (self.base_link,
                                                urllib.quote_plus(search_id))
            #print 'scraperchk - scrape_movie - start_url:  ' + start_url
            html = client.request(start_url)
            posts = client.parseDOM(html,
                                    'div',
                                    attrs={'class': 'one_movie-item'})
            for post in posts:
                data = dom.parse_dom(post,
                                     'a',
                                     req='href',
                                     attrs={'class': 'movie-title'})[0]
                if not clean_title(title) == clean_title(data.content):
                    continue
                qual = client.parseDOM(post,
                                       'span',
                                       attrs={'data-title': 'Quality'})[0]
                qual = client.replaceHTMLCodes(qual)
                item_url = urlparse.urljoin(self.base_link, data.attrs['href'])

                self.get_source(item_url, title, year, start_time, qual)
            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return self.sources
    def scrape_movie(self, title, year, imdb, debrid=False):
        try:
            start_time = time.time()
            search_id = urllib.quote_plus('%s %s' % (title, year))

            # search_id.replace(' ','+') = urllib.quote_plus(search_id)
            start_url = '%s/index.php?s=%s' % (self.base_link, search_id)
            #print 'CoolMovieZone - scrape_movie - start_url:  ' + start_url

            headers = {'User-Agent': client.agent()}
            html = client.request(start_url, headers=headers)

            match = client.parseDOM(html, 'h1')
            match = [
                dom_parser.parse_dom(i, 'a', req='href') for i in match if i
            ]
            match = [(i[0].attrs['href'], i[0].content) for i in match if i]
            for item_url, name in match:
                if year not in name: continue
                if not clean_title(title) == clean_title(name):
                    continue  #.lower() added on clean_title function

                self.get_source(item_url, title, year, '', '', start_time)
            return self.sources
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
Esempio n. 36
0
 def get_source(self, start_url, title, year, season, episode, start_time):
     try:
         #print 'URL PASSED OKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK'+start_url
         count = 0
         headers = {'User-Agent': client.agent()}
         r = client.request(start_url, headers=headers)
         #print r
         Endlinks = re.compile(
             'class="text-muted3 smaller pad-l2".+?style="color:green"></i>(.+?)</span>.+?rel="nofollow" href="(.+?)".+?class="progress-bar prog-blue prog-l".+?>(.+?)</div></div>',
             re.DOTALL).findall(r)
         #print 'scraperchk - scrape_movie - EndLinks: '+str(Endlinks)
         for qual, Magnet, size in Endlinks:
             #print Magnet + '<><><><><>'+size
             count += 1
             self.sources.append({
                 'source': 'Torrent',
                 'quality': size + qual,
                 'scraper': self.name,
                 'url': Magnet,
                 'direct': False,
                 'debridonly': True
             })
         if dev_log == 'true':
             end_time = time.time() - start_time
             send_log(self.name, end_time, count, title, year)
     except Exception, argument:
         if dev_log == 'true':
             error_log(self.name, argument)
         return []
Esempio n. 37
0
 def scrape_episode(self,
                    title,
                    show_year,
                    year,
                    season,
                    episode,
                    imdb,
                    tvdb,
                    debrid=False):
     try:
         start_time = time.time()
         search = clean_search(title)
         start_url = '%s/search.php?search=%s' % (self.base_link,
                                                  urllib.quote_plus(search))
         headers = {'User-Agent': client.agent()}
         link = client.request(start_url, headers=headers, timeout=5)
         links = link.split('class="box"')
         for p in links:
             media_url = re.compile('href="([^"]+)"').findall(p)[0]
             media_title = re.compile('title="([^"]+)"').findall(p)[0]
             if search in clean_search(media_title.lower()):
                 if 'season %s' % season in media_title.lower():
                     self.get_source(media_url, title, year, season,
                                     episode, start_time)
         return self.sources
     except Exception, argument:
         if dev_log == 'true':
             error_log(self.name, argument)
Esempio n. 38
0
    def get_source(self,media_url, title,year,season,episode,start_time):
        #print 'source season ' + media_url
        season_bollox = "0%s" % season if len(season) < 2 else season
        episode_bollox = "0%s" % episode if len(episode) < 2 else episode
        all_bollox = 's%se%s' % (season_bollox, episode_bollox)
            

        try:
            headers = {'User-Agent': client.agent()}
            html = client.request(media_url,headers=headers)
            match = re.findall(r'<li><a href="([^"]+)">([^<>]*)<span.+?>', str(html), re.I | re.DOTALL)
            count = 0
            for media_url, media_title in match:

                if all_bollox in media_title.lower():
             
                    link = client.request(media_url, headers=headers)

                    frame = client.parseDOM(link, 'iframe', ret='src')
                    print frame
                    for frame_link in frame:
                        self.sources.append({'source': 'Openload', 'quality': 'Unknown',
                                             'scraper': self.name, 'url': frame_link, 'direct': False})
                    

                    cool_links = re.compile('"dwn-box".+?ref="(.+?)" rel="nofollow">(.+?)<span',re.DOTALL).findall(link)
                    for vid_url, res in cool_links:
                        if '1080' in res:
                            res = '1080p'
                        elif '720' in res:
                            res = '720p'
                        elif 'HD' in res:
                            res = 'HD'
                        else:
                            res = 'SD'
                        count += 1

                        vid_url += '|User-Agent=%s&Referer=%s' % (client.agent(), media_url)
                        vid_url = urllib.quote(vid_url, '|:?/&+=_-')

                        self.sources.append({'source': 'Direct', 'quality': res, 'scraper': self.name, 'url': vid_url,
                                             'direct': True})
            if dev_log=='true':
                end_time = time.time() - start_time
                send_log(self.name, end_time, count, title, year, season='', episode='')
        except:
            pass
Esempio n. 39
0
    def get_source(self, item_url, title, year, start_time):
        try:
            print 'PASSEDURL >>>>>>'+item_url
            count = 0
            headers = {'User-Agent': client.agent()}
            OPEN = client.request(item_url, headers=headers)
            #print OPEN
            Endlinks = dom_parser.parse_dom(OPEN, 'a', req='player-data')

            Endlinks = [(i.attrs['player-data'], i.content) for i in Endlinks if i]
            if 'Season' in year:
                Endlinks = [(i[0], 'SD') for i in Endlinks if i[1] in year]
            else:
                Endlinks = [(i[0], i[1]) for i in Endlinks if i]

            #print 'series8 - scrape_movie - EndLinks: '+str(Endlinks)
            for link, quality in Endlinks:
                qual = quality_tags.check_sd_url(quality)

                if 'vidcloud' in link:
                    link = 'https:' + link if link.startswith('//') else link
                    data = client.request(link, headers=headers)
                    link = re.findall('''file\s*:\s*['"](.+?)['"].+?type['"]\s*:\s*['"](.+?)['"]''', data, re.DOTALL)[0]
                    host = link[1]
                    link = link[0] + '|User-Agent=%s&Referer=https://vidcloud.icu/' % client.agent()
                    direct = True
                else:
                    host = link.split('//')[1].replace('www.', '')
                    host = host.split('/')[0].split('.')[0].title()
                    direct = False

                count += 1
                self.sources.append({'source': host, 'quality': qual, 'scraper': self.name, 'url': link, 'direct': direct})
            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name, end_time, count, title, year)
        except Exception, argument:
            if dev_log=='true':
                error_log(self.name, argument)
            return[]

#seriesonline8().scrape_movie('Black Panther', '2018', 'tt1825683', False)
#seriesonline8().scrape_episode('Suits','2011','','8','5','','')
Esempio n. 40
0
    def scrape_movie(self, title, year, imdb, debrid=False):
        try:

            start_time = time.time()                                                   
            search_id = clean_search(title.lower())                                      
            start_url = '%s/?s=%s' %(self.base_link,search_id.replace(' ','+'))         
            #print 'scraperchk - scrape_movie - start_url:  ' + start_url                                  
            headers={'User-Agent': client.agent()}
            html = client.request(start_url, headers=headers)
            match = re.compile('class="thumb".+?title="(.+?)".+?href="(.+?)">',re.DOTALL).findall(html) 
            for name, item_url in match:
                print 'scraperchk - scrape_movie - name: '+name
                #print 'scraperchk - scrape_movie - item_url: '+item_url
                if year in name:                                                           
                    if clean_title(search_id).lower() == clean_title(name).lower():                                                                    
                        #print 'scraperchk - scrape_movie - Send this URL: ' + item_url                             
                        self.get_source(item_url,title,year,start_time)                                      
            #print self.sources
            return self.sources
        except Exception, argument:
            if dev_log=='true':
                error_log(self.name,argument) 
Esempio n. 41
0
    def scrape_movie(self, title, year, imdb, debrid=False):
        try:
            start_time = time.time()
            search = clean_search(title)
            start_url = '%s/%s/%s' % (self.base_link, self.search_link, search.replace(' ', '-'))
            #print 'series - scrape_movie - start_url:  ' + start_url
            
            headers={'User-Agent': client.agent()}
            html = client.request(start_url, headers=headers)
            match = re.compile('class="ml-item".+?href="(.+?)".+?alt="(.+?)"',re.DOTALL).findall(html)
            for item_url1, name in match:
                item_url = 'https://www2.series9.io'+item_url1+'/watching.html'
                print 'series8 - scrape_movie - item_url: '+item_url
                if clean_title(search) == clean_title(name):
                    #print 'series8 - scrape_movie - Send this URL: ' + item_url                             
                    self.get_source(item_url, title, year, start_time)

            #print self.sources
            return self.sources
        except Exception, argument:
            if dev_log=='true':
                error_log(self.name,argument) 
Esempio n. 42
0
    def get_source(self,item_url,title,year,start_time,qual):
        try:
            #print 'PASSEDURL >>>>>>'+item_url
            count = 0
            headers={'User-Agent': client.agent()}
            OPEN = client.request(item_url, headers=headers)
            Endlinks = re.compile('<iframe src="(.+?)"',re.DOTALL).findall(OPEN)
            #print 'scraperchk - scrape_movie - EndLinks: '+str(Endlinks)
            for link in Endlinks:
                #print 'scraperchk - scrape_movie - link: '+str(link)        
                count += 1
                host = link.split('//')[1].replace('www.','')
                host = host.split('/')[0].split('.')[0].title()
                self.sources.append({'source': host, 'quality': qual, 'scraper': self.name, 'url': link, 'direct': False})
            if dev_log == 'true':
                end_time = time.time() - start_time
                send_log(self.name, end_time, count, title, year)
        except Exception, argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return self.sources

#movienolimit().scrape_movie('Upgrade', '2018', '')
Esempio n. 43
0
    def scrape_episode(self, title, show_year, year, season, episode, imdb, tvdb, debrid=False):
        try:
            start_time = time.time()
            search = clean_search(title)
            start_url = '%s/search.php?search=%s' % (self.base_link, urllib.quote_plus(search))

            print 'SEARCH > '+start_url
            headers = {'User-Agent': client.agent()}
            link = client.request(start_url, headers=headers, timeout=5)
            links = link.split('class="box"')
            for p in links:

                media_url = re.compile('href="([^"]+)"').findall(p)[0]
                media_title = re.compile('title="([^"]+)"').findall(p)[0]
                if search in clean_search(media_title.lower()):
                    if 'season %s' % season in media_title.lower():
                        self.get_source(media_url, title, year, season, episode, start_time)
                
            print self.sources
            return self.sources
        except Exception, argument:        
            if dev_log == 'true':
                error_log(self.name,argument)
            return self.sources
Esempio n. 44
0
    def scrape_movie(self, title, year, imdb, debrid=False):
        try:
            start_time = time.time() 
            search_id = clean_search(title.lower())
            start_url = urlparse.urljoin(self.base_link, self.search_link % urllib.quote_plus(search_id))
            headers={'User-Agent': client.agent()}
            html = client.request(start_url, headers=headers)
            results = client.parseDOM(html, 'div', attrs={'class': 'video_title'})

            items = []
            for item in results:
                try:
                    data = dom_parser.parse_dom(item, 'a', req=['href', 'title'])[0]
                    t = data.content
                    y = re.findall('\((\d{4})\)', data.attrs['title'])[0]
                    qual = data.attrs['title'].split('-')[1]
                    link = data.attrs['href']

                    if not clean_title(t) == clean_title(title): continue
                    if not y == year: continue

                    items += [(link, qual)]

                except:
                    pass
            for item in items:
                count = 0
                try:
                    url = item[0] if item[0].startswith('http') else urlparse.urljoin(self.base_link, item[0])
                    r = client.request(url)

                    qual = client.parseDOM(r, 'h1')[0]
                    res = quality_tags.get_release_quality(item[1], qual)[0]

                    url = re.findall('''frame_url\s*=\s*["']([^']+)['"]\;''', r, re.DOTALL)[0]
                    url = url if url.startswith('http') else urlparse.urljoin('https://', url)
                    if 'vidlink' in url:
                        html = client.request(url, headers=headers)
                        action = re.findall("action'\s*:\s*'([^']+)", html)[0]
                        postID = re.findall("postID\s*=\s*'([^']+)", html)[0]
                        url = 'https://vidlink.org' + re.findall("var\s*url\s*=\s*'([^']+)", html)[0]
                        data = {'browserName': 'Firefox',
                                'platform': 'Win32',
                                'postID': postID,
                                'action': action}

                        headers['X-Requested-With'] = 'XMLHttpRequest'
                        headers['Referer'] = url
                        html = client.request(url, post=data, headers=headers)
                        html = jsunpack.unpack(html).replace('\\', '')
                        sources = json.loads(re.findall('window\.srcs\s*=\s*([^;]+)', html, re.DOTALL)[0])
                        for src in sources:
                            r = requests.head(src['url'], headers={'User-Agent': client.agent()})
                            if r.status_code < 400:
                                movie_link = src['url']
                                count += 1
                                self.sources.append({'source': 'Googlelink', 'quality': res,
                                                    'scraper': self.name, 'url': movie_link, 'direct': True})
                            else:
                               continue

                except:
                    pass
                if dev_log=='true':
                    end_time = time.time() - start_time
                    send_log(self.name,end_time, count, title,year)
            #print self.sources
            return self.sources
        except Exception, argument:
            print argument
            if dev_log == 'true':
                error_log(self.name,argument)
            return self.sources

#watch32().scrape_movie('Black Panther', '2018', 'tt1825683', False)
Esempio n. 45
0
    def scrape_episode(self, title, show_year, year, season, episode, imdb, tvdb, debrid=False):
        try:
            start_time = time.time()
            search_id = clean_search(title.lower())
            start_url = urlparse.urljoin(self.base_link, self.search_link % urllib.quote_plus(search_id))
            #print start_url
            headers = {'User-Agent': client.agent()}

            r = client.request(start_url, headers=headers)
            posts = client.parseDOM(r, 'div', attrs={'id': 'movie-\d+'})
            posts = [(client.parseDOM(i, 'h4')[0]) for i in posts if i]
            for item in posts:
                name = client.parseDOM(item, 'a')[0]
                link = client.parseDOM(item, 'a', ret='href')[0]
                if not clean_title(title) == clean_title(name): continue

                link = urlparse.urljoin(self.base_link, link)
                html = client.request(link)
                #<div class="season" id="season8">
                sep_id = 'Season %s Serie %s' % (int(season), int(episode))
                #print sep_id
                seasons = client.parseDOM(html, 'div', attrs={'class': 'season'})
                seasons = [i for i in seasons if 'season %s' % int(season) in i.lower()][0]

                epis = re.findall('<h3>(.+?)</div>\s+</div>\s+</div>\s+</div>', seasons, re.DOTALL | re.MULTILINE)
                epis = [i for i in epis if sep_id in i][0]

                count = 0
                streams = client.parseDOM(epis, 'div', attrs={'class': 'linkTr'})
                for stream in streams:
                    quality = client.parseDOM(stream, 'div', attrs={'class': 'linkQualityText'})[0]
                    link = client.parseDOM(stream, 'div', attrs={'class': 'linkHidden linkHiddenUrl'})[0]
                    #print link

                    if 'vidnode' in link:
                        continue

                    if 'HD' in quality:
                        quality = 'HD'
                    else:
                        quality = 'SD'

                    host = quality_tags._give_host(link)
                    # print host
                    count += 1
                    self.sources.append(
                        {'source': host, 'quality': quality, 'scraper': self.name, 'url': link, 'direct': False})

                if dev_log == 'true':
                    end_time = time.time() - start_time
                    send_log(self.name, end_time, count, title, year, season=season, episode=episode)

            return self.sources
        except Exception as argument:
            if dev_log == 'true':
                error_log(self.name, argument)
            return []


#vkflix().scrape_movie('Black Panther', '2018', '', False)
#vkflix().scrape_episode('Suits', '2011','','8','5','','')