Streamingcommunity: non riprodurre ultimo contenuto quando il selezionato uscirà prossimamente

This commit is contained in:
marco
2022-11-14 20:59:32 +01:00
parent 112b03cbe0
commit 5cc6c78228
3 changed files with 11 additions and 13 deletions
+4 -2
View File
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from wsgiref import headers
from core import httptools, support, filetools
from platformcode import logger, config
UA = httptools.random_useragent()
@@ -8,11 +7,14 @@ UA = httptools.random_useragent()
def test_video_exists(page_url):
global scws_id
logger.debug('page url=', page_url)
scws_id = ''
if page_url.isdigit():
scws_id = page_url
else:
scws_id = support.match(page_url, patron=r'scws_id[^:]+:(\d+)').match
page = httptools.downloadpage(page_url)
if page.url == page_url: # se non esiste, reindirizza all'ultimo url chiamato esistente
scws_id = support.scrapertools.find_single_match(page.data, r'scws_id[^:]+:(\d+)')
if not scws_id:
return False, config.get_localized_string(70449) % 'StreamingCommunityWS'