Fix AnimeWorld, aggiunto server AnaVids

This commit is contained in:
Alhaziel01
2020-05-18 12:32:06 +02:00
parent 9307f72b99
commit 8bff1d0ec4
5 changed files with 109 additions and 45 deletions
+8 -4
View File
@@ -1,8 +1,12 @@
# -*- coding: utf-8 -*-
import urllib
import sys
if sys.version_info[0] >= 3:
import urllib.parse as urllib
else:
import urllib
from core import httptools, jsontools
from platformcode import logger
from platformcode import logger, config
def test_video_exists(page_url):
@@ -11,7 +15,7 @@ def test_video_exists(page_url):
data_json = httptools.downloadpage(page_url.replace('/v/', '/api/source/'), headers=[['x-requested-with', 'XMLHttpRequest']], post=post).data
json = jsontools.load(data_json)
if not json['data']:
return False, "Video not found"
return False, config.get_localized_string(70449) % "AnimeWorld"
return True, ""
@@ -27,7 +31,7 @@ def get_video_url(page_url, user="", password="", video_password=""):
media_url = file['file']
label = file['label']
extension = file['type']
video_urls.append([label + " " + extension + ' [animeworld]', media_url])
video_urls.append([label + " " + extension + ' [AnimeWorld]', media_url])
return video_urls