mirror of https://gitlab.com/bashrc2/epicyon
Detect media within tag lists
parent
a5eba052ed
commit
54605937cd
17
utils.py
17
utils.py
|
@ -4695,6 +4695,23 @@ def get_media_url_from_video(post_json_object: {}) -> (str, str, str, str):
|
||||||
continue
|
continue
|
||||||
if not media_link.get('href'):
|
if not media_link.get('href'):
|
||||||
continue
|
continue
|
||||||
|
if media_link.get('tag'):
|
||||||
|
media_tags = media_link['tag']
|
||||||
|
if isinstance(media_tags, list):
|
||||||
|
for tag_link in media_tags:
|
||||||
|
if not isinstance(tag_link, dict):
|
||||||
|
continue
|
||||||
|
if not tag_link.get('mediaType'):
|
||||||
|
continue
|
||||||
|
if not tag_link.get('href'):
|
||||||
|
continue
|
||||||
|
if tag_link['mediaType'] == 'video/mp4' or \
|
||||||
|
tag_link['mediaType'] == 'video/ogv':
|
||||||
|
media_type = tag_link['mediaType']
|
||||||
|
media_url = remove_html(tag_link['href'])
|
||||||
|
break
|
||||||
|
if media_type and media_url:
|
||||||
|
continue
|
||||||
if media_link['mediaType'] == 'application/x-bittorrent':
|
if media_link['mediaType'] == 'application/x-bittorrent':
|
||||||
media_torrent = remove_html(media_link['href'])
|
media_torrent = remove_html(media_link['href'])
|
||||||
if media_link['href'].startswith('magnet:'):
|
if media_link['href'].startswith('magnet:'):
|
||||||
|
|
Loading…
Reference in New Issue