mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-09 12:17:25 +08:00
Get player url from relative path
This commit is contained in:
parent
dd6ba65ff7
commit
bc455bfea2
@ -11,7 +11,8 @@ from ..utils import (
|
|||||||
int_or_none,
|
int_or_none,
|
||||||
js_to_json,
|
js_to_json,
|
||||||
ExtractorError,
|
ExtractorError,
|
||||||
urlencode_postdata
|
urlencode_postdata,
|
||||||
|
urljoin
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +106,7 @@ class FunimationIE(InfoExtractor):
|
|||||||
if series:
|
if series:
|
||||||
title = '%s - %s' % (series, title)
|
title = '%s - %s' % (series, title)
|
||||||
description = self._html_search_meta(['description', 'og:description'], webpage, fatal=True)
|
description = self._html_search_meta(['description', 'og:description'], webpage, fatal=True)
|
||||||
subtitles = self.get_subtitles(video_id, display_id)
|
subtitles = self.get_subtitles(url, video_id, display_id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
headers = {}
|
headers = {}
|
||||||
@ -155,9 +156,8 @@ class FunimationIE(InfoExtractor):
|
|||||||
'formats': formats,
|
'formats': formats,
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_subtitles(self, video_id, display_id):
|
def get_subtitles(self, url, video_id, display_id):
|
||||||
#TODO get url based on value passed in e.g., https://www.funimationnow.uk/
|
player_url = urljoin(url, '/player/' + video_id)
|
||||||
player_url = 'https://www.funimation.com/player/' + video_id
|
|
||||||
player_page = self._download_webpage(player_url, display_id)
|
player_page = self._download_webpage(player_url, display_id)
|
||||||
text_tracks_search = self._search_regex(
|
text_tracks_search = self._search_regex(
|
||||||
r'("textTracks": \[{.+?}\])',
|
r'("textTracks": \[{.+?}\])',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user