def retrieveVideoInfo(video_id): video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_info_link = 'http://movzap.com/' + str(video_id) html = http.HttpClient().get_html_content(url=video_info_link) video_link = None paramSet = re.compile("return p\}\(\'(.+?)\',(\d\d),(\d\d),\'(.+?)\'").findall(html) if len(paramSet) > 0: video_info_link = encoders.parse_packed_value(paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'') img_data = re.compile(r"image:\'(.+?)\'").findall(video_info_link) if len(img_data) == 1: video.set_thumb_image(img_data[0]) video_link = re.compile(r"file:\'(.+?)\'").findall(video_info_link)[0] else: video_link = re.compile("'file': '(.+?)'").findall(html)[0] video.set_stopped(False) video.add_stream_link(STREAM_QUAL_SD, video_link) except Exception, e: logging.getLogger().error(e) video.set_stopped(True)
def retrieveVideoInfo(video_id): video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_info_link = 'http://www.vidpe.com/' + str(video_id) html = http.HttpClient().get_html_content(url=video_info_link) video_link = None paramSet = re.compile("return p\}\(\'(.+?)\',(\d\d),(\d\d),\'(.+?)\'").findall(html) if len(paramSet) > 0: video_info_link = encoders.parse_packed_value(paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'') img_data = re.compile(r"image:\'(.+?)\'").findall(video_info_link) if len(img_data) == 1: video.set_thumb_image(img_data[0]) video_link = re.compile(r"file:\'(.+?)\'").findall(video_info_link)[0] else: video_link = re.compile("'file': '(.+?)'").findall(html)[0] video.set_stopped(False) video.add_stream_link(STREAM_QUAL_SD, video_link) except: video.set_stopped(True) return video
def retrieveVideoInfo(video_id): video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_info_link = 'http://playu.net/embed-' + str(video_id) + '-540x304.html' html = http.HttpClient().get_html_content(url=video_info_link) paramSet = re.compile("return p\}\(\'(.+?)\',(\d+),(\d+),\'(.+?)\'").findall(html) if len(paramSet) > 0: video_info_link = encoders.parse_packed_value(paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'') img_data = re.compile(r"image:\'(.+?)\'").findall(video_info_link) if len(img_data) == 1: video.set_thumb_image(img_data[0]) video_link = re.compile(r"file:\'(.+?)\'").findall(video_info_link)[0] else: html = html.replace(' ', '') html = html.replace('\'', '"') video_link = 'http' + re.compile('\,\{file:"http(.+?)mp4"').findall(html)[0] + 'mp4' img_link = re.compile('image:"(.+?)"').findall(html)[0] video.set_thumb_image(img_link) video.set_stopped(False) video.add_stream_link(STREAM_QUAL_SD, video_link) video.set_thumb_image(img_link) except: video.set_stopped(True) return video
def retrieveVideoInfo(video_id): video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_link = 'http://letwatch.us/embed-' + str(video_id) + '-620x496.html' logging.getLogger().debug('URL : ' + video_link) html = http.HttpClient().get_html_content(url=video_link) paramSet = re.compile("return p\}\(\'(.+?)\',(\d*),(\d*),\'(.+?)\'").findall(html) video_info_link = None if len(paramSet) > 0: video_info_link = encoders.parse_packed_value(paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'') logging.getLogger().debug(video_info_link) img_link = re.compile("image\:'(.+?)'").findall(video_info_link)[0] hd_video_link = re.compile("file\:'(.+?)',label\:'SD'").findall(video_info_link) if len(hd_video_link) > 0: video.add_stream_link(STREAM_QUAL_HD_720, hd_video_link[0]) sd_video_link = re.compile("file\:'(.+?)',label\:'HD'").findall(video_info_link) if len(sd_video_link) > 0: video.add_stream_link(STREAM_QUAL_SD, sd_video_link[0]) logging.getLogger().debug(video.get_streams()) video.set_stopped(False) video.set_thumb_image(img_link) video.set_name("LetWatch Video") except: video.set_stopped(True) return video
def retrieveVideoInfo(video_id): video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_link = 'http://letwatch.us/embed-' + str( video_id) + '-620x496.html' logging.getLogger().debug('URL : ' + video_link) html = http.HttpClient().get_html_content(url=video_link) paramSet = re.compile( "return p\}\(\'(.+?)\',(\d*),(\d*),\'(.+?)\'").findall(html) video_info_link = None if len(paramSet) > 0: video_info_link = encoders.parse_packed_value( paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'') logging.getLogger().debug(video_info_link) img_link = re.compile("image\:'(.+?)'").findall(video_info_link)[0] hd_video_link = re.compile("file\:'(.+?)',label\:'SD'").findall( video_info_link) if len(hd_video_link) > 0: video.add_stream_link(STREAM_QUAL_HD_720, hd_video_link[0]) sd_video_link = re.compile("file\:'(.+?)',label\:'HD'").findall( video_info_link) if len(sd_video_link) > 0: video.add_stream_link(STREAM_QUAL_SD, sd_video_link[0]) logging.getLogger().debug(video.get_streams()) video.set_stopped(False) video.set_thumb_image(img_link) video.set_name("LetWatch Video") except: video.set_stopped(True) return video
def retrieveVideoInfo(video_id): video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_info_link = 'http://playu.net/embed-' + str(video_id) + '-540x304.html' html = http.HttpClient().get_html_content(url=video_info_link) paramSet = re.compile("return p\}\(\'(.+?)\',(\d+),(\d+),\'(.+?)\'").findall(html) if len(paramSet) > 0: video_info_link = encoders.parse_packed_value(paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'') img_data = re.compile(r"image:\'(.+?)\'").findall(video_info_link) if len(img_data) == 1: video.set_thumb_image(img_data[0]) video_link = re.compile(r"file:\'(.+?)\'").findall(video_info_link)[0] else: html = html.replace(' ', '') html = html.replace('\'', '"') try: video_link = 'http' + re.compile('file:"http(.+?)m3u8"').findall(html)[0] + 'm3u8' except: video_link = 'http' + re.compile('file:"http(.+?)mp4"').findall(html)[0] + 'mp4' img_link = re.compile('image:"(.+?)"').findall(html)[0] video.set_thumb_image(img_link) video.set_stopped(False) video.add_stream_link(STREAM_QUAL_SD, video_link) video.set_thumb_image(img_link) except: video.set_stopped(True) return video
def retrieveVideoInfo(video_id): # Old Method #import urlresolver #videoUrl = 'http://letwatch.us/embed-' + str(video_id) + '-595x430.html' #media = urlresolver.HostedMediaFile(url=videoUrl, title='') #New method to get 720links video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_link = 'http://letwatch.us/embed-' + str( video_id) + '-595x430.html' html = http.HttpClient().get_html_content(url=video_link) paramSet = re.compile( "return p\}\(\'(.+?)\',(\d+),(\d+),\'(.+?)\'").findall(html) print paramSet if len(paramSet) > 0: video_info_link = encoders.parse_packed_value( paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'') img_data = re.compile(r"image:\'(.+?)\'").findall(video_info_link) if len(img_data) == 1: video.set_thumb_image(img_data[0]) video_link = re.compile(r"file:\'(.+?)\'").findall( video_info_link)[0] else: html = html.replace(' ', '') html = html.replace('\'', '"') try: video_link = 'http' + re.compile( 'file:"http(.+?)m3u8"').findall(html)[0] + 'm3u8' except: video_link = 'http' + re.compile( 'file:"http(.+?)mp4"').findall(html)[0] + 'mp4' img_link = re.compile('image:"(.+?)"').findall(html)[0] video.set_thumb_image(img_link) video.set_stopped(False) video.add_stream_link(STREAM_QUAL_SD, video_link) except: video.set_stopped(True) return video
def retrieveVideoInfo(video_id): video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_info_link = "http://idowatch.net/embed-" + str(video_id) + "-520x400.html" headers = { "User-Agent": "Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8", "Referer:": "http://www.desi-tashan.com/ido/", } request = urllib2.Request(video_info_link, None, headers) response = urllib2.urlopen(request) html = response.read() response.close() paramSet = re.compile("return p\}\('(.+?)',(\d+),(\d+),'(.+?)'").findall(html) if len(paramSet) > 0: video_info_link = ( encoders.parse_packed_value( paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split("|") ) .replace("\\", "") .replace('"', "'") ) img_data = re.compile(r"image:\'(.+?)\'").findall(video_info_link) if len(img_data) == 1: video.set_thumb_image(img_data[0]) video_link = re.compile(r"file:\'(.+?)\'").findall(video_info_link)[0] else: html = html.replace(" ", "") html = html.replace("'", '"') try: video_link = "http" + re.compile('file:"http(.+?)m3u8"').findall(html)[0] + "m3u8" except: video_link = "http" + re.compile('file:"http(.+?)mp4"').findall(html)[0] + "mp4" img_link = re.compile('image:"(.+?)"').findall(html)[0] video.set_thumb_image(img_link) video.set_stopped(False) video.add_stream_link(STREAM_QUAL_SD, video_link) except: video.set_stopped(True) return video
def retrieveVideoInfo(video_id): # Old Method #import urlresolver #videoUrl = 'http://letwatch.us/embed-' + str(video_id) + '-595x430.html' #media = urlresolver.HostedMediaFile(url=videoUrl, title='') #New method to get 720links video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_link = 'http://letwatch.us/embed-' + str(video_id) + '-595x430.html' html = http.HttpClient().get_html_content(url=video_link) paramSet = re.compile("return p\}\(\'(.+?)\',(\d+),(\d+),\'(.+?)\'").findall(html) print paramSet if len(paramSet) > 0: video_info_link = encoders.parse_packed_value(paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'') img_data = re.compile(r"image:\'(.+?)\'").findall(video_info_link) if len(img_data) == 1: video.set_thumb_image(img_data[0]) video_link = re.compile(r"file:\'(.+?)\'").findall(video_info_link)[0] else: html = html.replace(' ', '') html = html.replace('\'', '"') try: video_link = 'http' + re.compile('file:"http(.+?)m3u8"').findall(html)[0] + 'm3u8' except: video_link = 'http' + re.compile('file:"http(.+?)mp4"').findall(html)[0] + 'mp4' img_link = re.compile('image:"(.+?)"').findall(html)[0] video.set_thumb_image(img_link) video.set_stopped(False) video.add_stream_link(STREAM_QUAL_SD, video_link) except: video.set_stopped(True) return video
def retrieveVideoInfo(video_id): video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_info_link = "http://watchvideo2.us/embed-" + str(video_id) + "-540x304.html" html = http.HttpClient().get_html_content(url=video_info_link) paramSet = re.compile("return p\}\('(.+?)',(\d+),(\d+),'(.+?)'").findall(html) if len(paramSet) > 0: video_info_link = ( encoders.parse_packed_value( paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split("|") ) .replace("\\", "") .replace('"', "'") ) img_data = re.compile(r"image:\'(.+?)\'").findall(video_info_link) if len(img_data) == 1: video.set_thumb_image(img_data[0]) video_link = re.compile(r"file:\'(.+?)\'").findall(video_info_link)[0] else: html = html.replace(" ", "") html = html.replace("'", '"') try: video_link = "http" + re.compile('file:"http(.+?)m3u8"').findall(html)[0] + "m3u8" except: video_link = "http" + re.compile('file:"http(.+?)mp4"').findall(html)[0] + "mp4" img_link = re.compile('image:"(.+?)"').findall(html)[0] video.set_thumb_image(img_link) video.set_stopped(False) video.add_stream_link(STREAM_QUAL_SD, video_link) video.set_thumb_image(img_link) except: video.set_stopped(True) return video
def retrieveVideoInfo(video_id): video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_info_link = 'http://idowatch.net/embed-' + str(video_id) + '-520x400.html' headers = {'User-Agent' : 'Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3', 'Accept' : 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Referer:' : 'http://www.desi-tashan.com/ido/'} request = urllib2.Request(video_info_link,None,headers) response = urllib2.urlopen(request) html = response.read() response.close() paramSet = re.compile("return p\}\(\'(.+?)\',(\d+),(\d+),\'(.+?)\'").findall(html) if len(paramSet) > 0: video_info_link = encoders.parse_packed_value(paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'') img_data = re.compile(r"image:\'(.+?)\'").findall(video_info_link) if len(img_data) == 1: video.set_thumb_image(img_data[0]) video_link = re.compile(r"file:\'(.+?)\'").findall(video_info_link)[0] else: html = html.replace(' ', '') html = html.replace('\'', '"') try: video_link = 'http' + re.compile('file:"http(.+?)m3u8"').findall(html)[0] + 'm3u8' except: video_link = 'http' + re.compile('file:"http(.+?)mp4"').findall(html)[0] + 'mp4' img_link = re.compile('image:"(.+?)"').findall(html)[0] video.set_thumb_image(img_link) video.set_stopped(False) video.add_stream_link(STREAM_QUAL_SD, video_link) except: video.set_stopped(True) return video
def retrieveVideoInfo(video_id): video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_info_link = 'http://vidwatch3.me/embed-' + str( video_id) + '-540x304.html' html = http.HttpClient().get_html_content(url=video_info_link) html = html.replace(' ', '') html = html.replace('\'', '"') final_video_link = '' try: video_link = 'http' + re.compile('file:"http(.+?)m3u8"').findall( html)[0] + 'm3u8' img_link = re.compile('image:"(.+?)"').findall(html)[0] video.set_thumb_image(img_link) except: try: video_link = 'http' + re.compile( 'file:"http(.+?)mp4"').findall(html)[0] + 'mp4' except: video_link = '' if ('.m3u8' in video_link): try: html = cache_page(url=video_link) final_video_link = 'http' + re.compile( 'http(.+?)m3u8').findall(html)[0] + 'm3u8' except: final_video_link = video_link if final_video_link == '' or final_video_link == None: paramSet = re.compile( "returnp\}\(\"(.+?)\",(\d+),(\d+),\"(.+?)\"").findall(html) try: if len(paramSet) > 0: video_info_link = encoders.parse_packed_value( paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace( '"', '\'') img_data = re.compile(r"image:\'(.+?)\'").findall( video_info_link) if len(img_data) == 1: video.set_thumb_image(img_data[0]) sources = re.compile(r"sources\:\[(.+?)\]").findall( video_info_link)[0] video_link = re.compile(r"file:\'(.+?)\'").findall( sources)[0] if 'm3u8' not in video_link: try: video_link = re.compile(r"file:\'(.+?)\'").findall( sources)[1] except: video_link = re.compile(r"file:\'(.+?)\'").findall( sources)[0] else: try: html = http.HttpClient().get_html_content( url=video_link) html = html.replace(' ', '') html = html.replace('\'', '"') final_video_link = 'http' + re.compile( 'http(.+?)m3u8').findall(html)[0] + 'm3u8' except: final_video_link = video_link except: final_video_link = '' if final_video_link == '' or final_video_link == None: final_video_link = video_link video.set_stopped(False) video.add_stream_link(STREAM_QUAL_SD, final_video_link) except: video.set_stopped(True) return video
video_host.set_name(VIDEO_HOST_NAME) return video_host def retrieveVideoInfo(video_id): <<<<<<< HEAD video = Video() video.set_video_host(getVideoHost()) video.set_id(video_id) try: video_link = 'http://letwatch.us/embed-' + str(video_id) + '-620x496.html' logging.getLogger().debug('URL : ' + video_link) html = http.HttpClient().get_html_content(url=video_link) paramSet = re.compile("return p\}\(\'(.+?)\',(\d*),(\d*),\'(.+?)\'").findall(html) video_info_link = None if len(paramSet) > 0: video_info_link = encoders.parse_packed_value(paramSet[0][0], int(paramSet[0][1]), int(paramSet[0][2]), paramSet[0][3].split('|')).replace('\\', '').replace('"', '\'') logging.getLogger().debug(video_info_link) img_link = re.compile("image\:'(.+?)'").findall(video_info_link)[0] hd_video_link = re.compile("file\:'(.+?)',label\:'SD'").findall(video_info_link) if len(hd_video_link) > 0: video.add_stream_link(STREAM_QUAL_HD_720, hd_video_link[0]) sd_video_link = re.compile("file\:'(.+?)',label\:'HD'").findall(video_info_link) if len(sd_video_link) > 0: video.add_stream_link(STREAM_QUAL_SD, sd_video_link[0]) logging.getLogger().debug(video.get_streams()) video.set_stopped(False) video.set_thumb_image(img_link) video.set_name("LetWatch Video") ======= # Old Method #import urlresolver