Пример #1
0
	def createMeta(self, url, provider, logo, quality, links, key, riptype, vidtype='Movie', lang='en', sub_url=None, txt='', file_ext = '.mp4', testing=False, poster=None, headers=None, page_url=None):
	
		files_ret = []
		orig_url = url

		if testing == True:
			links.append(url)
			return links
			
		if control.setting('Host-%s' % name) == False:
			log('INFO','createMeta','Host Disabled by User')
			return links
			
		try:
			urldata = client.b64encode(json.dumps('', encoding='utf-8'))
			params = client.b64encode(json.dumps('', encoding='utf-8'))
			
			online = check(url)
			vidurls, err, sub_url_t = getAllQuals(url, online)
			
			if vidurls == None:
				log(type='ERROR',method='createMeta-1', err=u'%s' % err)
				return links
				
			if sub_url_t != None:
				sub_url = sub_url_t
			
			seq = 0
			for vv in vidurls:
				durl = vv['page']
				vidurl = vv['file']
				if vidurl != None:
					quality = vv['label']
					fs = vv['fs']

					try:
						log(type='INFO',method='createMeta', err=u'durl:%s ; res:%s; fs:%s' % (durl,quality,fs))
						files_ret.append({'source':self.name, 'maininfo':'', 'titleinfo':txt, 'quality':quality, 'vidtype':vidtype, 'rip':riptype, 'provider':provider, 'orig_url':orig_url, 'url':vidurl, 'durl':durl, 'urldata':urldata, 'params':params, 'logo':logo, 'online':online, 'allowsDownload':self.allowsDownload, 'resumeDownload':self.resumeDownload, 'allowsStreaming':self.allowsStreaming, 'key':key, 'enabled':True, 'fs':int(fs), 'file_ext':file_ext, 'ts':time.time(), 'lang':lang, 'poster':poster, 'sub_url':sub_url, 'subdomain':client.geturlhost(url), 'page_url':page_url, 'misc':{'player':'iplayer', 'gp':False}, 'seq':seq})
					except Exception as e:
						log(type='ERROR',method='createMeta', err=u'%s' % e)
						files_ret.append({'source':urlhost, 'maininfo':'', 'titleinfo':txt, 'quality':quality, 'vidtype':vidtype, 'rip':'Unknown' ,'provider':provider, 'orig_url':orig_url, 'url':vidurl, 'durl':durl, 'urldata':urldata, 'params':params, 'logo':logo, 'online':online, 'allowsDownload':self.allowsDownload, 'resumeDownload':self.resumeDownload, 'allowsStreaming':self.allowsStreaming, 'key':key, 'enabled':True, 'fs':int(fs), 'file_ext':file_ext, 'ts':time.time(), 'lang':lang, 'sub_url':sub_url, 'poster':poster, 'subdomain':client.geturlhost(url), 'page_url':page_url, 'misc':{'player':'iplayer', 'gp':False}, 'seq':seq})
					seq += 1
		except Exception as e:
			log('ERROR', 'createMeta', '%s' % e)
			
		for fr in files_ret:
			if fr != None and 'key' in fr.keys():
				control.setPartialSource(fr,self.name)
				links.append(fr)
			
		if len(files_ret) > 0:
			log('SUCCESS', 'createMeta', 'Successfully processed %s link >>> %s' % (provider, orig_url), dolog=self.init)
		else:
			log('FAIL', 'createMeta', 'Failed in processing %s link >>> %s' % (provider, orig_url), dolog=self.init)
			
		log('INFO', 'createMeta', 'Completed', dolog=self.init)
			
		return links
Пример #2
0
	def createMeta(self, url, provider, logo, quality, links, key, riptype, vidtype='Movie', lang='en', sub_url=None, txt='', file_ext = '.mp4', testing=False, poster=None, headers=None, page_url=None):
	
		files_ret = []
		orig_url = url
		
		if testing == True:
			links.append(url)
			return links
			
		if control.setting('Host-%s' % name) == False:
			log('INFO','createMeta','Host Disabled by User')
			return links
			
		try:
			items = self.process(url, quality, riptype, headers, page_url)
			seq = 0
			
			for item in items:
				
				vidurl = item['src']
				durl = url
				
				allowsStreaming = item['allowsStreaming']
				allowsDownload = item['allowsDownload']
				quality = item['quality']
				riptype = item['riptype']
				fs = item['fs']
				online = item['online']
				params = item['params']
				urldata = item['urldata']
				
				try:
					log(type='INFO',method='createMeta', err=u'durl:%s ; res:%s; fs:%s' % (durl,quality,fs))
					files_ret.append({'source':self.name, 'maininfo':txt, 'titleinfo':'', 'quality':quality, 'vidtype':vidtype, 'rip':riptype, 'provider':provider, 'orig_url':orig_url, 'url':vidurl, 'durl':durl, 'urldata':urldata, 'params':params, 'logo':logo, 'online':online, 'allowsDownload':allowsDownload, 'resumeDownload':self.resumeDownload, 'allowsStreaming':allowsStreaming, 'key':key, 'enabled':True, 'fs':int(fs), 'file_ext':file_ext, 'ts':time.time(), 'lang':lang, 'sub_url':sub_url, 'poster':poster, 'subdomain':client.geturlhost(url), 'page_url':page_url, 'misc':{'player':'eplayer', 'gp':True}, 'seq':seq})
				except Exception as e:
					log(type='ERROR',method='createMeta', err=u'%s' % e)
					files_ret.append({'source':urlhost, 'maininfo':txt, 'titleinfo':'', 'quality':quality, 'vidtype':vidtype, 'rip':'Unknown' ,'provider':provider, 'orig_url':orig_url, 'url':vidurl, 'durl':url, 'urldata':urldata, 'params':params, 'logo':logo, 'online':online, 'allowsDownload':allowsDownload, 'resumeDownload':self.resumeDownload, 'allowsStreaming':allowsStreaming, 'key':key, 'enabled':True, 'fs':int(fs), 'file_ext':file_ext, 'ts':time.time(), 'lang':lang, 'sub_url':sub_url, 'poster':poster, 'subdomain':client.geturlhost(url), 'page_url':page_url, 'misc':{'player':'eplayer', 'gp':True}, 'seq':seq})
				seq += 1
				
		except Exception as e:
			log(type='ERROR', err="createMeta : %s" % e.args)
			
		for fr in files_ret:
			if fr != None and 'key' in fr.keys():
				control.setPartialSource(fr,self.name)
				links.append(fr)

		if len(files_ret) > 0:
			log('SUCCESS', 'createMeta', 'Successfully processed %s link >>> %s' % (provider, orig_url), dolog=self.init)
		else:
			log('FAIL', 'createMeta', 'Failed in processing %s link >>> %s' % (provider, orig_url), dolog=self.init)
			
		log('INFO', 'createMeta', 'Completed', dolog=self.init)
		
		return links
Пример #3
0
	def createMeta(self, url, provider, logo, quality, links, key, riptype, vidtype='Movie', lang='en', sub_url=None, txt='', file_ext = '.mp4', testing=False, poster=None, headers=None, page_url=None):
	
		files_ret = []
		orig_url = url
		
		if testing == True:
			links.append(url)
			return links
			
		if control.setting('Host-%s' % name) == False:
			log('INFO','createMeta','Host Disabled by User')
			return links
	
		try:
			urldata = client.b64encode(json.dumps('', encoding='utf-8'))
			params = client.b64encode(json.dumps('', encoding='utf-8'))
			online = check(url)
			titleinfo = txt
			maininfo = ''
			fs = 0

			try:
				furl, fs, file_ext1, err = mega.get_mega_dl_link(url)
				if err != '':
					raise Exception(err)
				if file_ext1 != None:
					file_ext = file_ext1
				if file_ext not in ['.mp4','.mkv','.avi']:
					titleinfo = '%s%s' % (txt+' ' if len(txt)>0 else '', file_ext+' file')
				
				quality = qual_based_on_fs(quality, fs)
				
				if int(fs) == 0:
					fs = client.getFileSize(furl)
				urldata = createurldata(furl, quality)
			except Exception as e:
				online = False
				log('FAIL', 'createMeta-1', '%s - %s' % (url,e))
				maininfo = '*File Unavailable*'

			try:
				log(type='INFO',method='createMeta', err=u'durl:%s ; res:%s; fs:%s' % (url,quality,fs))
				files_ret.append({'source':self.name, 'maininfo':maininfo, 'titleinfo':titleinfo, 'quality':quality, 'vidtype':vidtype, 'rip':riptype, 'provider':provider, 'orig_url':orig_url, 'durl':url, 'url':url, 'urldata':urldata, 'params':params, 'logo':logo, 'allowsDownload':self.allowsDownload, 'resumeDownload':self.resumeDownload, 'allowsStreaming':self.allowsStreaming, 'online':online, 'key':key, 'enabled':True, 'fs':int(fs), 'file_ext':file_ext, 'ts':time.time(), 'lang':lang, 'sub_url':sub_url, 'poster':poster, 'subdomain':self.netloc[0], 'page_url':page_url, 'misc':{'player':'iplayer', 'gp':False}, 'seq':0})
			except Exception as e:
				log('ERROR', 'createMeta-2', '%s - %s' % (url,e))
				files_ret.append({'source':urlhost, 'maininfo':maininfo, 'titleinfo':titleinfo, 'quality':quality, 'vidtype':vidtype, 'rip':'Unknown' ,'provider':provider, 'orig_url':orig_url, 'durl':url, 'url':url, 'urldata':urldata, 'params':params, 'logo':logo, 'online':online, 'allowsDownload':self.allowsDownload, 'resumeDownload':self.resumeDownload, 'allowsStreaming':self.allowsStreaming, 'key':key, 'enabled':True, 'fs':int(fs), 'file_ext':file_ext, 'ts':time.time(), 'lang':lang, 'sub_url':sub_url, 'poster':poster, 'subdomain':self.netloc[0], 'page_url':page_url, 'misc':{'player':'iplayer', 'gp':False}, 'seq':0})
		except Exception as e:
			log('ERROR', 'createMeta', '%s' % e)
			
		for fr in files_ret:
			if fr != None and 'key' in fr.keys():
				control.setPartialSource(fr,self.name)
				links.append(fr)

		if len(files_ret) > 0:
			log('SUCCESS', 'createMeta', 'Successfully processed %s link >>> %s' % (provider, orig_url), dolog=self.init)
		else:
			log('FAIL', 'createMeta', 'Failed in processing %s link >>> %s' % (provider, orig_url), dolog=self.init)
			
		log('INFO', 'createMeta', 'Completed', dolog=self.init)
		
		return links
Пример #4
0
	def createMeta(self, url, provider, logo, quality, links, key, riptype, vidtype='Movie', lang='en', sub_url=None, txt='', file_ext = '.mp4', testing=False, poster=None, headers=None, page_url=None):
	
		files_ret = []
		url = url.replace('oload.tv','openload.co').replace('/embed/','/f/')
		orig_url = url
			
		if testing == True:
			links.append(url)
			return links
			
		if control.setting('Host-%s' % name) == False:
			log('INFO','createMeta','Host Disabled by User')
			return links
			
		try:
			durl = url
			
			urldata = client.b64encode(json.dumps('', encoding='utf-8'))
			params = client.b64encode(json.dumps('', encoding='utf-8'))
			a1 = None
			
			if control.setting('use_openload_pairing') == True:
				isPairRequired, a1 = isPairingRequired(url)
				if isPairRequired == True:
					isPairRequired, a1 = isPairingRequired(url)
				#print "isPairRequired %s" % isPairRequired
			else:
				isPairRequired = False
				
			page_html = client.request(url)
				
			if a1 != None:
				vidurl = a1
			else:
				vidurl, err, sub_url_t, r1 = resolve(url, usePairing=False)
				if sub_url == None:
					sub_url = sub_url_t
				
			if vidurl != None:
				isPairRequired = False

			pair = ''

			if isPairRequired == True:
				pair = ' *Pairing required* '
				if isPairingDone():
					pair = ' *Paired* '
					
			if vidurl == None:
				vidurl = url
			
			online, r1, r2, fs, r3, sub_url_t = check(vidurl, videoData=page_html, usePairing=False, embedpage=True)
			
			if online == False:
				pair = ' *Vid Unavailable* '
			
			file_title = ''
			try:
				file_title = client.parseDOM(page_html, 'title')[0]
			except:
				try:
					file_title = client.parseDOM(page_html, 'span', attrs = {'class': 'title'})[0]
				except:
					try:
						file_title = client.parseDOM(page_html, 'h3', attrs = {'class': 'other-title-bold'})[0]
					except:
						pass
						
			if sub_url == None:
				sub_url = sub_url_t
			
			titleinfo = txt
			
			try:
				log(type='INFO',method='createMeta', err=u'pair:%s; online:%s; durl:%s ; res:%s; fs:%s' % (isPairRequired,online,vidurl,quality,fs))
				files_ret.append({'source':self.name, 'maininfo':pair, 'titleinfo':titleinfo, 'quality':file_quality(vidurl, quality, file_title), 'vidtype':vidtype, 'rip':rip_type(vidurl, riptype, file_title), 'provider':provider, 'orig_url':orig_url, 'url':vidurl, 'durl':durl, 'urldata':urldata, 'params':params, 'logo':logo, 'online':online, 'allowsDownload':self.allowsDownload, 'resumeDownload':self.resumeDownload, 'allowsStreaming':self.allowsStreaming, 'key':key, 'enabled':True, 'fs':int(fs), 'file_ext':file_ext, 'ts':time.time(), 'lang':lang, 'sub_url':sub_url, 'poster':poster, 'subdomain':client.geturlhost(url), 'page_url':page_url, 'misc':{'pair':isPairRequired, 'player':'iplayer', 'gp':False}, 'seq':0})
			except Exception as e:
				log(type='ERROR',method='createMeta-3', err=u'%s' % e)
				files_ret.append({'source':urlhost, 'maininfo':pair, 'titleinfo':titleinfo, 'quality':quality, 'vidtype':vidtype, 'rip':'Unknown' ,'provider':provider, 'orig_url':orig_url, 'url':vidurl, 'durl':durl, 'urldata':urldata, 'params':params, 'logo':logo, 'online':online, 'allowsDownload':self.allowsDownload, 'resumeDownload':self.resumeDownload, 'allowsStreaming':self.allowsStreaming, 'key':key, 'enabled':True, 'fs':int(fs), 'file_ext':file_ext, 'ts':time.time(), 'lang':lang, 'sub_url':sub_url, 'poster':poster, 'subdomain':client.geturlhost(url), 'page_url':page_url, 'misc':{'pair':isPairRequired, 'player':'eplayer', 'gp':False}, 'seq':0})
		except Exception as e:
			log('ERROR', 'createMeta', '%s' % e)
			
		for fr in files_ret:
			if fr != None and 'key' in fr.keys():
				control.setPartialSource(fr,self.name)
				links.append(fr)

		if len(files_ret) > 0:
			log('SUCCESS', 'createMeta', 'Successfully processed %s link >>> %s' % (provider, orig_url), dolog=self.init)
		else:
			log('FAIL', 'createMeta', 'Failed in processing %s link >>> %s' % (provider, orig_url), dolog=self.init)
			
		log('INFO', 'createMeta', 'Completed', dolog=self.init)
		
		return links
Пример #5
0
    def createMeta(self,
                   url,
                   provider,
                   logo,
                   quality,
                   links,
                   key,
                   riptype,
                   vidtype='Movie',
                   lang='en',
                   sub_url=None,
                   txt='',
                   file_ext='.mp4',
                   testing=False,
                   poster=None,
                   headers=None,
                   page_url=None):

        files_ret = []
        orig_url = url

        if testing == True:
            links.append(url)
            return links

        if control.setting('Host-%s' % name) == False:
            log('INFO', 'createMeta', 'Host Disabled by User')
            return links

        try:
            if 'vidcloud.icu/load' in url:
                raise Exception('No mp4 Video found')
            elif 'vidcloud.icu/download' in url:
                headersx = {'Referer': url, 'User-Agent': client.agent()}
                page_data, head, ret, cookie = client.request(
                    url, output='extended', headers=headersx)
                try:
                    cookie = re.findall(r'Set-Cookie:(.*)', str(ret),
                                        re.MULTILINE)[0].strip()
                except:
                    pass
                headersx['Cookie'] = cookie
                mp4_vids = re.findall(r'\"(http.*?.mp4.*?)\"', page_data)
                items = []
                for u in mp4_vids:
                    u = u.strip().replace(' ', '%20').replace('&', '&')
                    fs = client.getFileSize(u, headers=headersx)
                    q = qual_based_on_fs(quality, fs)
                    online = check(u, headers=headersx)
                    urldata = client.b64encode(json.dumps('',
                                                          encoding='utf-8'))
                    params = client.b64encode(json.dumps('', encoding='utf-8'))
                    if headersx != None:
                        paramsx = {'headers': headers}
                        params = client.b64encode(
                            json.dumps(paramsx, encoding='utf-8'))

                    items.append({
                        'quality': q,
                        'riptype': riptype,
                        'src': u,
                        'fs': fs,
                        'online': online,
                        'params': params,
                        'urldata': urldata,
                        'allowsStreaming': False
                    })

                seq = 0
                for item in items:

                    durl = url
                    vidurl = item['src']
                    allowsStreaming = item['allowsStreaming']
                    quality = item['quality']
                    riptype = item['riptype']
                    fs = item['fs']
                    online = item['online']
                    params = item['params']
                    urldata = item['urldata']

                    try:
                        log(type='INFO',
                            method='createMeta',
                            err=u'durl:%s ; res:%s; fs:%s' %
                            (durl, quality, fs))
                        files_ret.append({
                            'source': self.name,
                            'maininfo': txt,
                            'titleinfo': '',
                            'quality': quality,
                            'vidtype': vidtype,
                            'rip': riptype,
                            'provider': provider,
                            'orig_url': orig_url,
                            'url': vidurl,
                            'durl': durl,
                            'urldata': urldata,
                            'params': params,
                            'logo': logo,
                            'online': online,
                            'allowsDownload': self.allowsDownload,
                            'resumeDownload': self.resumeDownload,
                            'allowsStreaming': allowsStreaming,
                            'key': key,
                            'enabled': True,
                            'fs': int(fs),
                            'file_ext': file_ext,
                            'ts': time.time(),
                            'lang': lang,
                            'sub_url': sub_url,
                            'poster': poster,
                            'subdomain': client.geturlhost(url),
                            'page_url': page_url,
                            'misc': {
                                'player': 'iplayer',
                                'gp': True
                            },
                            'seq': seq
                        })
                    except Exception as e:
                        log(type='ERROR', method='createMeta', err=u'%s' % e)
                        files_ret.append({
                            'source': urlhost,
                            'maininfo': txt,
                            'titleinfo': '',
                            'quality': quality,
                            'vidtype': vidtype,
                            'rip': 'Unknown',
                            'provider': provider,
                            'orig_url': orig_url,
                            'url': vidurl,
                            'durl': durl,
                            'urldata': urldata,
                            'params': params,
                            'logo': logo,
                            'online': online,
                            'allowsDownload': self.allowsDownload,
                            'resumeDownload': self.resumeDownload,
                            'allowsStreaming': allowsStreaming,
                            'key': key,
                            'enabled': True,
                            'fs': int(fs),
                            'file_ext': file_ext,
                            'ts': time.time(),
                            'lang': lang,
                            'sub_url': sub_url,
                            'poster': poster,
                            'subdomain': client.geturlhost(url),
                            'page_url': page_url,
                            'misc': {
                                'player': 'iplayer',
                                'gp': True
                            },
                            'seq': seq
                        })
                    seq += 1

            elif url != None:
                online = True
                result = client.request(orig_url, httpsskip=True)
                if 'Sorry, this video reuploading' in result:
                    online = False

                if online == True:
                    vids = client.parseDOM(
                        result, 'ul', attrs={'class': 'list-server-items'})[0]
                    vids = client.parseDOM(vids,
                                           'li',
                                           attrs={'class': 'linkserver'},
                                           ret='data-video')
                    vids = list(set(vids))
                    for video_url in vids:
                        video_urlx = video_url
                        if 'http' not in video_urlx:
                            video_urlx = 'http:' + video_urlx
                        if video_urlx != None and 'vidcloud.icu/load' not in video_urlx:
                            log(type='INFO',
                                method='createMeta',
                                err=u'url:%s requires additional processing' %
                                video_urlx)
                            video_url1 = '%s' % client.request(
                                video_urlx,
                                followredirect=True,
                                httpsskip=True,
                                output='geturl')
                            if video_url1 != None and 'http' in video_url1 and 'vidcloud.icu' not in video_url1:
                                try:
                                    files_ret = resolvers.createMeta(
                                        video_url1,
                                        provider,
                                        logo,
                                        quality,
                                        files_ret,
                                        key,
                                        poster=poster,
                                        riptype=riptype,
                                        vidtype=vidtype,
                                        sub_url=sub_url,
                                        testing=testing,
                                        headers=headers,
                                        page_url=page_url)
                                except Exception as e:
                                    log(type='ERROR',
                                        method='createMeta',
                                        err=u'%s' % e)
                        elif video_urlx != None and 'vidcloud.icu/load' in video_urlx:
                            log(type='INFO',
                                method='createMeta',
                                err=u'url:%s requires additional processing' %
                                video_urlx)
                            id = re.findall(r'id=(.*?)&', video_urlx)[0]
                            u = 'https://vidcloud.icu/download?id=%s' % id
                            res = client.request(u)
                            mp4_vids = re.findall(r'http.*?mp4', res)
                            if len(mp4_vids) > 0:
                                try:
                                    files_ret = resolvers.createMeta(
                                        u,
                                        provider,
                                        logo,
                                        quality,
                                        files_ret,
                                        key,
                                        poster=poster,
                                        riptype=riptype,
                                        vidtype=vidtype,
                                        sub_url=sub_url,
                                        testing=testing,
                                        headers=headers,
                                        page_url=page_url,
                                        urlhost='vidcloud.icu')
                                except Exception as e:
                                    log(type='ERROR',
                                        method='createMeta',
                                        err=u'%s' % e)
                            elif len(mp4_vids) == 0 and video_url == vids[
                                    len(vids) - 1] and len(files_ret) == 0:
                                raise Exception('No mp4 Video found')
        except Exception as e:
            log('FAIL', 'createMeta', '%s' % e)

        for fr in files_ret:
            if fr != None and 'key' in fr.keys():
                control.setPartialSource(fr, self.name)
                links.append(fr)

        if len(files_ret) > 0:
            log('SUCCESS',
                'createMeta',
                'Successfully processed %s link >>> %s' % (provider, orig_url),
                dolog=self.init)
        else:
            log('FAIL',
                'createMeta',
                'Failed in processing %s link >>> %s' % (provider, orig_url),
                dolog=self.init)

        log('INFO', 'createMeta', 'Completed', dolog=self.init)

        return links