fix streamtape e polpotv
This commit is contained in:
+23
-12
@@ -1,27 +1,38 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
# --------------------------------------------------------
|
||||
# Conector streamtape By Alfa development Group
|
||||
# --------------------------------------------------------
|
||||
import re
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
from platformcode import logger, config
|
||||
from platformcode import logger
|
||||
import sys
|
||||
|
||||
PY3 = False
|
||||
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
|
||||
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
global data
|
||||
data = httptools.downloadpage(page_url).data
|
||||
|
||||
referer = {"Referer": page_url}
|
||||
|
||||
data = httptools.downloadpage(page_url, headers=referer).data
|
||||
|
||||
if "Video not found" in data:
|
||||
return False, config.get_localized_string(70449) % "Streamtape"
|
||||
return False, "[streamtape] El archivo no existe o ha sido borrado"
|
||||
|
||||
return True, ""
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.info("url=" + page_url)
|
||||
|
||||
video_urls = []
|
||||
global data
|
||||
|
||||
url = scrapertools.find_single_match(data, 'id="videolink"[^>]+>\n?\s*//(.*?)<')
|
||||
if url:
|
||||
media_url = 'https://' + url + '&stream=1'
|
||||
video_urls.append([".mp4 [Streamtape]", media_url])
|
||||
|
||||
return video_urls
|
||||
url = "https:" + scrapertools.find_single_match(data, 'innerHTML = "([^"]+)')
|
||||
url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "")
|
||||
video_urls.append(['MP4 [streamtape]', url])
|
||||
return video_urls
|
||||
Reference in New Issue
Block a user