Beispiel #1
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[]
Beispiel #2
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
Beispiel #3
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
Beispiel #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
Beispiel #5
0
 def get_source(self, item_url, title, year, season, episode, start_time):
     count = 0
     try:
         if item_url is None:
             return self.sources
         qual = re.search('Quality\s*:(.+?)<br', item_url,
                          re.DOTALL).groups()[0]
         qual = re.sub('<.+?>', '', qual)
         qual, info = quality_tags.get_release_quality(qual, qual)
         headers = {
             'Origin': self.base_link,
             'Referer': client.parseDOM(item_url, 'link')[0],
             'X-Requested-With': 'XMLHttpRequest',
             'User_Agent': client.agent()
         }
         fn = client.parseDOM(item_url,
                              'input',
                              attrs={'name': 'FName'},
                              ret='value')[0]
         fs = client.parseDOM(item_url,
                              'input',
                              attrs={'name': 'FSize'},
                              ret='value')[0]
         fsid = client.parseDOM(item_url,
                                'input',
                                attrs={'name': 'FSID'},
                                ret='value')[0]
         #params = re.compile('<input name="FName" type="hidden" value="(.+?)" /><input name="FSize" type="hidden" value="(.+?)" /><input name="FSID" type="hidden" value="(.+?)"').findall(html)
         post_url = self.base_link + '/thanks-for-downloading/'
         form_data = {'FName': fn, 'FSize': fs, 'FSID': fsid}
         #link = requests.post(request_url, data=form_data, headers=headers).content
         link = client.request(post_url, post=form_data, headers=headers)
         stream_url = client.parseDOM(link,
                                      'meta',
                                      attrs={'http-equiv': 'refresh'},
                                      ret='content')[0]
         stream_url = client.replaceHTMLCodes(stream_url).split('url=')[-1]
         stream_url += '|User-Agent=%s' % urllib.quote(client.agent())
         count += 1
         self.sources.append({
             'source': 'DirectLink',
             'quality': qual,
             'scraper': self.name,
             'url': stream_url,
             'direct': True
         })
         if dev_log == 'true':
             end_time = time.time() - start_time
             send_log(self.name,
                      end_time,
                      count,
                      title + ' | ' + stream_url,
                      year,
                      season=season,
                      episode=episode)
     except:
         pass
Beispiel #6
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','','')
Beispiel #7
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)
                    headers = {'User-Agent': client.agent()}
                    url = urlparse.urljoin(self.base_link, url)
                    r = client.request(url, headers=headers)
                    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
Beispiel #8
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
Beispiel #9
0
 def scrape_movie(self, title, year, imdb, debrid=False):
     count = 0
     try:
         start_time = time.time()
         search_id = '%s %s' % (clean_search(title), year)
         start_url = urlparse.urljoin(self.base_link, self.search_link % urllib.quote_plus(search_id))
         headers = {'User-Agent': client.agent()}
         html = requests.get(start_url, headers=headers, timeout=5).content
         posts = client.parseDOM(html, 'item')
         posts = [(client.parseDOM(i, 'title')[0], client.parseDOM(i, 'a', ret='href')) for i in posts if i]
         posts = [i[1] for i in posts if clean_title(i[0]) == clean_title(title)][0]
         for url in posts:
             if 'cmovies' in url:
                 continue
             link = 'https:' + url if url.startswith('//') else url
             if '1080' in link:
                 qual = '1080p'
             elif '720' in link:
                 qual = '720p'
             else:
                 qual = 'SD'
             host = url.split('//')[1].replace('www.', '')
             host = host.split('/')[0].split('.')[0].title()
             count += 1
             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)
         return self.sources
     except Exception, argument:
         if dev_log == 'true':
             error_log(self.name, argument)
         return self.sources
Beispiel #10
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)
Beispiel #11
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
Beispiel #12
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)
Beispiel #13
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="iaconbox center floatright".+?title="Torrent magnet link" href="(.+?)">.+?class="cellMainLink">(.+?)</a>.+?class="nobr center">(.+?)</span></td>',
             re.DOTALL).findall(r)
         #print 'scraperchk - scrape_movie - EndLinks: '+str(Endlinks)
         for Magnet, quality, size in Endlinks:
             Magnet = Magnet.replace('https://mylink.me.uk/?url=', '')
             qual = quality_tags.check_sd_url(quality)
             #print Magnet + '<><><><><>'
             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 []
Beispiel #14
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
Beispiel #15
0
 def scrape_movie(self, title, year, imdb, debrid=False):
     try:
         count = 0
         urls = []
         start_time = time.time()
         search_id = clean_search(title.lower())
         start_url = '%s/search/?keyword=%s' %(self.base_link, urllib.quote_plus(search_id))
         headers = {'User-Agent': client.agent(), 'Referer': self.base_link}
         scraper = cfscrape.create_scraper()
         html = scraper.get(start_url, headers=headers).content
         match = re.compile('class="ml-item".+?href="(.+?)".+?<b>(.+?)</b>.+?<b>(.+?)</b>.+?alt="(.+?)"',re.DOTALL).findall(html)
         for item_url1, date, res, name in match:
             item_url = urlparse.urljoin(self.base_link, item_url1)
             if not clean_title(search_id) == clean_title(name):
                 continue
             OPEN = scraper.get(item_url, headers=headers).content
             Endlinks = re.compile('class="movie_links"><li(.+?)<h3><b class="icon-share-alt"', re.DOTALL).findall(OPEN)[0]
             links = re.compile('target="_blank" href="(.+?)"', re.DOTALL).findall(Endlinks)
             for link in links:
                 if not link.startswith('http'):
                     continue
                 count += 1
                 host = link.split('//')[1].replace('www.', '')
                 host = host.split('/')[0]
                 if not filter_host(host):
                     continue
                 self.sources.append({'source': host, 'quality': res, '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
Beispiel #16
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()}
         #scraper= cfscrape.create_scraper()
         #r=scraper.get(start_url, headers=headers)
         r = client.request(start_url, headers=headers)
         #print r
         Endlinks = re.compile(
             'class="imagnet icon16" href="(.+?)">.+?<font color=#004E98>(.+?)</font>.+?><b>(.+?)</b></a',
             re.DOTALL).findall(r)
         #print 'scraperchk - scrape_movie - EndLinks: '+str(Endlinks)
         for Magnet, size, quality in Endlinks:
             #Magnet=Magnet.replace('https://mylink.me.uk/?url=', '')
             qual = quality_tags.get_release_quality(quality, None)[0]
             #print Magnet + '<><><><><>'
             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 []
Beispiel #17
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
Beispiel #18
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', '')
Beispiel #19
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="nobr center">(.+?)</span></td>.+?title="Torrent magnet link" href="(.+?)".+?class="cellMainLink">(.+?)</a>',
             re.DOTALL).findall(r)
         #print 'scraperchk - scrape_movie - EndLinks: '+str(Endlinks)
         for size, Magnet, qual in Endlinks:
             Magnet = Magnet.replace('https://mylink.cx/?url=', '')
             Magnet = Magnet.replace('%3A',
                                     ':').replace('%3F', '?').replace(
                                         '%3D', '=').split('%26dn')[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 []
Beispiel #20
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
Beispiel #21
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','','')
    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','','')
Beispiel #23
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
Beispiel #24
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 []
    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)
    def scrape_movie(self, title, year, imdb, debrid=False):
        try:
            start_time = time.time() 
            search_id = '%s %s' % (clean_search(title.lower()), year)
            start_url = urlparse.urljoin(self.base_link, self.search_link % urllib.quote_plus(search_id))

            headers={'User-Agent': client.agent()}
            scraper = cfscrape.create_scraper()
            html = scraper.get(start_url, headers=headers).content
            #xbmc.log('@#@DATA:%s' % html, xbmc.LOGNOTICE)
            data = client.parseDOM(html, 'div', attrs={'id': 'content_box'})[0]
            data = client.parseDOM(data, 'h2') #returns a list with all search results
            data = [dom_parser.parse_dom(i, 'a', req=['href', 'title'])[0] for i in data if i] #scraping url-title
            links = [(i.attrs['href'], i.attrs['title']) for i in data if i] #list with link-title for each result
            #links = re.compile('<header>.+?href="(.+?)" title="(.+?)"',re.DOTALL).findall(html)
            #xbmc.log('@#@LINKS:%s' % links, xbmc.LOGNOTICE)
            for m_url, m_title in links:
                movie_year = re.findall("(\d{4})", re.sub('\d{3,4}p', '', m_title))[-1]
                movie_name = m_title.split(movie_year)[0]

                if not clean_title(title) == clean_title(movie_name):
                    continue
                if not year in movie_year:
                    continue
                url = m_url

                #error_log(self.name + ' Pass',url)
                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
    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)
Beispiel #28
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 []
Beispiel #29
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)
    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
Beispiel #31
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)
Beispiel #32
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
Beispiel #34
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
Beispiel #35
0
 def get_source(self, item_url, title, year, start_time):
     try:
         count = 0
         headers = {'User-Agent': client.agent()}
         OPEN = client.request(item_url, headers=headers)
         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]
         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 []
Beispiel #36
0
 def __init__(self):
     self.sources = []
     self.base_link = 'https://filepursuit.com'
     self.search_links = [
         '/%s?q=%s&type=video', '/%s?q=%s&type=video&startrow=49',
         '/%s?q=%s&type=video&startrow=98',
         '/%s?q=%s&type=video&startrow=147'
     ]
     self.search_referer = 'https://filepursuit.com/pursuit?q={0}'
     self.ua = client.agent()
    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
Beispiel #38
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
Beispiel #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','','')
Beispiel #40
0
    def get_source(self,url, title, year, season, episode, start_time):
        try:
            scraper = cfscrape.create_scraper()
            headers = {'Origin': 'http://hdpopcorns.com', 'Referer': url,
                       'X-Requested-With': 'XMLHttpRequest',
                       'User-Agent': client.agent()}
            count = 0
            data = scraper.get(url, headers=headers).content
            data = client.parseDOM(data, 'div', attrs={'class': 'thecontent'})[0]
            FN720p = client.parseDOM(data, 'input', ret='value', attrs={'name': 'FileName720p'})[0]
            FS720p = client.parseDOM(data, 'input', ret='value', attrs={'name': 'FileSize720p'})[0]
            FSID720p = client.parseDOM(data, 'input', ret='value', attrs={'name': 'FSID720p'})[0]
            FN1080p = client.parseDOM(data, 'input', ret='value', attrs={'name': 'FileName1080p'})[0]
            FS1080p = client.parseDOM(data, 'input', ret='value', attrs={'name': 'FileSize1080p'})[0]
            FSID1080p = client.parseDOM(data, 'input', ret='value', attrs={'name': 'FSID1080p'})[0]
            post = {'FileName720p': FN720p, 'FileSize720p': FS720p, 'FSID720p': FSID720p,
                    'FileName1080p': FN1080p, 'FileSize1080p': FS1080p, 'FSID1080p': FSID1080p,
                    'x': 173, 'y': 22}
            data = scraper.post('%s/select-movie-quality.php' % self.base_link, data=post).content
            data = client.parseDOM(data, 'div', attrs={'id': 'btn_\d+p'})

            u = [client.parseDOM(i, 'a', ret='href')[0] for i in data]
            for url in u:
                quality, info = quality_tags.get_release_quality(url, url)

                url = client.replaceHTMLCodes(url)
                url = url.encode('utf-8')
                count += 1
                self.sources.append(
                    {'source': 'DirectLink', 'quality': quality, '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, season=season,episode=episode)              
        except:
            pass

#hdpopcorn().scrape_movie('Blade Runner 2049', '2017', '', False) title contains 2 years
#hdpopcorn().scrape_movie('Deadpool 2', '2018', '', False) title contains number
Beispiel #41
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) 
Beispiel #42
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) 
Beispiel #43
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', '')
Beispiel #44
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
Beispiel #45
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)
Beispiel #46
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','','')