projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[theplatform] fix pid extraction in the platform feed
[youtube-dl]
/
youtube_dl
/
extractor
/
theplatform.py
diff --git
a/youtube_dl/extractor/theplatform.py
b/youtube_dl/extractor/theplatform.py
index 1555aa77cac30c18de3f0c2db9e13ea00cc569f6..f2e975ab0d3e3c4672e16cb0d35214161e097614 100644
(file)
--- a/
youtube_dl/extractor/theplatform.py
+++ b/
youtube_dl/extractor/theplatform.py
@@
-16,11
+16,12
@@
from ..compat import (
from ..utils import (
determine_ext,
ExtractorError,
from ..utils import (
determine_ext,
ExtractorError,
- xpath_with_ns,
- unsmuggle_url,
+ float_or_none,
int_or_none,
int_or_none,
+ sanitized_Request,
+ unsmuggle_url,
url_basename,
url_basename,
-
float_or_none
,
+
xpath_with_ns
,
)
default_ns = 'http://www.w3.org/2005/SMIL21/Language'
)
default_ns = 'http://www.w3.org/2005/SMIL21/Language'
@@
-84,7
+85,7
@@
class ThePlatformBaseIE(InfoExtractor):
class ThePlatformIE(ThePlatformBaseIE):
_VALID_URL = r'''(?x)
(?:https?://(?:link|player)\.theplatform\.com/[sp]/(?P<provider_id>[^/]+)/
class ThePlatformIE(ThePlatformBaseIE):
_VALID_URL = r'''(?x)
(?:https?://(?:link|player)\.theplatform\.com/[sp]/(?P<provider_id>[^/]+)/
- (?:(?P<media>(?:
[^/]+/)+select/
media/)|(?P<config>(?:[^/\?]+/(?:swf|config)|onsite)/select/))?
+ (?:(?P<media>(?:
(?:[^/]+/)+select/)?
media/)|(?P<config>(?:[^/\?]+/(?:swf|config)|onsite)/select/))?
|theplatform:)(?P<id>[^/\?&]+)'''
_TESTS = [{
|theplatform:)(?P<id>[^/\?&]+)'''
_TESTS = [{
@@
-204,7
+205,12
@@
class ThePlatformIE(ThePlatformBaseIE):
smil_url = url
# Explicitly specified SMIL (see https://github.com/rg3/youtube-dl/issues/7385)
elif '/guid/' in url:
smil_url = url
# Explicitly specified SMIL (see https://github.com/rg3/youtube-dl/issues/7385)
elif '/guid/' in url:
- webpage = self._download_webpage(url, video_id)
+ headers = {}
+ source_url = smuggled_data.get('source_url')
+ if source_url:
+ headers['Referer'] = source_url
+ request = sanitized_Request(url, headers=headers)
+ webpage = self._download_webpage(request, video_id)
smil_url = self._search_regex(
r'<link[^>]+href=(["\'])(?P<url>.+?)\1[^>]+type=["\']application/smil\+xml',
webpage, 'smil url', group='url')
smil_url = self._search_regex(
r'<link[^>]+href=(["\'])(?P<url>.+?)\1[^>]+type=["\']application/smil\+xml',
webpage, 'smil url', group='url')
@@
-278,7
+284,7
@@
class ThePlatformFeedIE(ThePlatformBaseIE):
duration = None
for item in entry['media$content']:
smil_url = item['plfile$url'] + '&format=SMIL&Tracking=true&Embedded=true&formats=MPEG4,F4M'
duration = None
for item in entry['media$content']:
smil_url = item['plfile$url'] + '&format=SMIL&Tracking=true&Embedded=true&formats=MPEG4,F4M'
- cur_video_id =
url_basename
(smil_url)
+ cur_video_id =
ThePlatformIE._match_id
(smil_url)
if first_video_id is None:
first_video_id = cur_video_id
duration = float_or_none(item.get('plfile$duration'))
if first_video_id is None:
first_video_id = cur_video_id
duration = float_or_none(item.get('plfile$duration'))