Fix OkStream

This commit is contained in:
Alhaziel01
2021-05-31 18:39:43 +02:00
parent 21feea854e
commit e7038d0e58
2 changed files with 5 additions and 5 deletions

View File

@@ -4,7 +4,7 @@
"ignore_urls": [],
"patterns": [
{
"pattern": "okstream.cc/([0-9a-zA-Z]+)",
"pattern": "okstream.cc/(?:e)?/([0-9a-zA-Z]+)",
"url": "https://www.okstream.cc/e/\\1"
}
]

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
from core import httptools, scrapertools
from core import httptools, support
from platformcode import logger, config
def test_video_exists(page_url):
@@ -8,7 +8,7 @@ def test_video_exists(page_url):
logger.debug('page url=', 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'
else:
data = response.data
@@ -19,8 +19,8 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
global data
logger.debug("URL", page_url)
video_urls = []
keys = scrapertools.find_single_match(data, '>var keys="([^"]+)"')
protection = scrapertools.find_single_match(data, '>var protection="([^"]+)"')
keys = support.match(data, patron=r'>var keys="([^"]+)"').match
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 = url.strip()
video_urls.append([url.split('.')[-1] + " [OkStream]", url])