Skip to content

Commit

Permalink
[tv4] Fix extraction and extract series metadata (closes #22443)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw authored and pareronia committed Jun 22, 2020
1 parent b499595 commit 95fabd7
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions youtube_dl/extractor/tv4.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ def _real_extract(self, url):
video_id = self._match_id(url)

info = self._download_json(
'http://www.tv4play.se/player/assets/%s.json' % video_id,
video_id, 'Downloading video info JSON')
'https://playback-api.b17g.net/asset/%s' % video_id,
video_id, 'Downloading video info JSON', query={
'service': 'tv4',
'device': 'browser',
'protocol': 'hls,dash',
'drm': 'widevine',
})['metadata']

title = info['title']

Expand Down Expand Up @@ -111,5 +116,9 @@ def _real_extract(self, url):
'timestamp': parse_iso8601(info.get('broadcast_date_time')),
'duration': int_or_none(info.get('duration')),
'thumbnail': info.get('image'),
'is_live': info.get('is_live') is True,
'is_live': info.get('isLive') is True,
'series': info.get('seriesTitle'),
'season_number': int_or_none(info.get('seasonNumber')),
'episode': info.get('episodeTitle'),
'episode_number': int_or_none(info.get('episodeNumber')),
}

0 comments on commit 95fabd7

Please sign in to comment.