Skip to content

Commit 30a3a4c

Browse files
committed
[lbry] Add support for HLS videos (closes ytdl-org#27877, closes ytdl-org#28768)
1 parent a00a7e0 commit 30a3a4c

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

youtube_dl/extractor/lbry.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,26 @@ class LBRYIE(LBRYBaseIE):
120120
'channel_url': 'https://lbry.tv/@LBRYFoundation:0ed629d2b9c601300cacf7eabe9da0be79010212',
121121
'vcodec': 'none',
122122
}
123+
}, {
124+
# HLS
125+
'url': 'https://odysee.com/@gardeningincanada:b/plants-i-will-never-grow-again.-the:e',
126+
'md5': 'fc82f45ea54915b1495dd7cb5cc1289f',
127+
'info_dict': {
128+
'id': 'e51671357333fe22ae88aad320bde2f6f96b1410',
129+
'ext': 'mp4',
130+
'title': 'PLANTS I WILL NEVER GROW AGAIN. THE BLACK LIST PLANTS FOR A CANADIAN GARDEN | Gardening in Canada 🍁',
131+
'description': 'md5:9c539c6a03fb843956de61a4d5288d5e',
132+
'timestamp': 1618254123,
133+
'upload_date': '20210412',
134+
'release_timestamp': 1618254002,
135+
'release_date': '20210412',
136+
'tags': list,
137+
'duration': 554,
138+
'channel': 'Gardening In Canada',
139+
'channel_id': 'b8be0e93b423dad221abe29545fbe8ec36e806bc',
140+
'channel_url': 'https://odysee.com/@gardeningincanada:b8be0e93b423dad221abe29545fbe8ec36e806bc',
141+
'formats': 'mincount:3',
142+
}
123143
}, {
124144
'url': 'https://odysee.com/@BrodieRobertson:5/apple-is-tracking-everything-you-do-on:e',
125145
'only_matching': True,
@@ -163,10 +183,18 @@ def _real_extract(self, url):
163183
streaming_url = self._call_api_proxy(
164184
'get', claim_id, {'uri': uri}, 'streaming url')['streaming_url']
165185
info = self._parse_stream(result, url)
186+
urlh = self._request_webpage(
187+
streaming_url, display_id, note='Downloading streaming redirect url info')
188+
if determine_ext(urlh.geturl()) == 'm3u8':
189+
info['formats'] = self._extract_m3u8_formats(
190+
urlh.geturl(), display_id, 'mp4', entry_protocol='m3u8_native',
191+
m3u8_id='hls')
192+
self._sort_formats(info['formats'])
193+
else:
194+
info['url'] = streaming_url
166195
info.update({
167196
'id': claim_id,
168197
'title': title,
169-
'url': streaming_url,
170198
})
171199
return info
172200

0 commit comments

Comments
 (0)