Skip to content

Commit

Permalink
[bbc] Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
qtlunya committed Nov 19, 2021
1 parent ea3d630 commit db670b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions yt_dlp/extractor/bbc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import itertools
import json
import re
from collections import defaultdict

from .common import InfoExtractor
from ..compat import (
Expand Down Expand Up @@ -453,7 +452,7 @@ def _download_playlist(self, playlist_id):
'http://www.bbc.co.uk/programmes/%s/playlist.json' % playlist_id,
playlist_id, 'Downloading playlist JSON')
formats = []
subtitles = defaultdict(list)
subtitles = {}

for version in playlist.get('allAvailableVersions', []):
smp_config = version['smpConfig']
Expand All @@ -470,9 +469,10 @@ def _download_playlist(self, playlist_id):
for f in version_formats:
f['format_note'] = ', '.join(types)
if any('AudioDescribed' in x for x in types):
f['preference'] = -10
f['language_preference'] = -10
formats += version_formats
for tag, subformats in (version_subtitles or {}).items():
subtitles.setdefault(tag, [])
subtitles[tag] += subformats

return programme_id, title, description, duration, formats, subtitles
Expand Down

0 comments on commit db670b9

Please sign in to comment.