more consistent vidstream (#485)
parent
41a75c61a5
commit
6a6bf49ede
|
@ -55,13 +55,21 @@ class VidStream(BaseExtractor):
|
|||
|
||||
|
||||
def _get_link(self,soup):
|
||||
"""
|
||||
Matches something like
|
||||
f("MTE2MDIw&title=Yakusoku+no+Neverland");
|
||||
"""
|
||||
sources_regex = r'>\s*?f\("(.*?)"\);'
|
||||
sources_url = re.search(sources_regex,str(soup)).group(1)
|
||||
sources_json = helpers.get(f'https://vidstreaming.io/ajax.php?id={sources_url}', referer=self.url).json()
|
||||
|
||||
# Gets:
|
||||
# <input type="hidden" id="id" value="MTEyMzg1">
|
||||
# <input type="hidden" id="title" value="Yakusoku+no+Neverland">
|
||||
# <input type="hidden" id="typesub" value="SUB">
|
||||
# Used to create a download url.
|
||||
soup_id = soup.select('input#id')[0]['value']
|
||||
soup_title = soup.select('input#title')[0]['value']
|
||||
soup_typesub = soup.select('input#typesub')[0].get('value','SUB')
|
||||
|
||||
sources_json = helpers.get(f'https://vidstreaming.io/ajax.php', params = {
|
||||
'id':soup_id,
|
||||
'typesub':soup_typesub,
|
||||
'title':soup_title,
|
||||
}, referer=self.url).json()
|
||||
|
||||
logger.debug('Sources json: {}'.format(str(sources_json)))
|
||||
"""
|
||||
|
@ -80,7 +88,7 @@ class VidStream(BaseExtractor):
|
|||
"""
|
||||
|
||||
servers = Config._read_config()['siteconfig']['vidstream']['servers']
|
||||
print(sources_json["source"][0]["file"])
|
||||
|
||||
for i in servers:
|
||||
if i in sources_keys:
|
||||
if sources_keys[i] in sources_json:
|
||||
|
|
Loading…
Reference in New Issue