Fix OkStream
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
"ignore_urls": [],
|
"ignore_urls": [],
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"pattern": "okstream.cc/([0-9a-zA-Z]+)",
|
"pattern": "okstream.cc/(?:e)?/([0-9a-zA-Z]+)",
|
||||||
"url": "https://www.okstream.cc/e/\\1"
|
"url": "https://www.okstream.cc/e/\\1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from core import httptools, scrapertools
|
from core import httptools, support
|
||||||
from platformcode import logger, config
|
from platformcode import logger, config
|
||||||
|
|
||||||
def test_video_exists(page_url):
|
def test_video_exists(page_url):
|
||||||
@@ -8,7 +8,7 @@ def test_video_exists(page_url):
|
|||||||
logger.debug('page url=', page_url)
|
logger.debug('page url=', page_url)
|
||||||
response = httptools.downloadpage(page_url)
|
response = httptools.downloadpage(page_url)
|
||||||
|
|
||||||
if response.code == 404:
|
if response.code == 404 or 'File has been removed or does not exist!' in response.data:
|
||||||
return False, config.get_localized_string(70449) % 'OkStream'
|
return False, config.get_localized_string(70449) % 'OkStream'
|
||||||
else:
|
else:
|
||||||
data = response.data
|
data = response.data
|
||||||
@@ -19,8 +19,8 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
global data
|
global data
|
||||||
logger.debug("URL", page_url)
|
logger.debug("URL", page_url)
|
||||||
video_urls = []
|
video_urls = []
|
||||||
keys = scrapertools.find_single_match(data, '>var keys="([^"]+)"')
|
keys = support.match(data, patron=r'>var keys="([^"]+)"').match
|
||||||
protection = scrapertools.find_single_match(data, '>var protection="([^"]+)"')
|
protection = support.match(data, patron=r'>var protection="([^"]+)"').match
|
||||||
url = httptools.downloadpage("https://www.okstream.cc/request/", post='&morocco={}&mycountry={}'.format(keys, protection), headers={'Referer':page_url}).data
|
url = httptools.downloadpage("https://www.okstream.cc/request/", post='&morocco={}&mycountry={}'.format(keys, protection), headers={'Referer':page_url}).data
|
||||||
url = url.strip()
|
url = url.strip()
|
||||||
video_urls.append([url.split('.')[-1] + " [OkStream]", url])
|
video_urls.append([url.split('.')[-1] + " [OkStream]", url])
|
||||||
|
|||||||
Reference in New Issue
Block a user