Compare commits

...

9 Commits

Author SHA1 Message Date
slipinthedove
135cc6601c Merge branch 'globo-re-re-re-re-re-write' of github.com:slipinthedove/yt-dlp into globo-re-re-re-re-re-write 2024-12-21 00:52:08 -03:00
slipinthedove
b0a3708308 sigh 2024-12-21 00:50:44 -03:00
dove
5807662118 this is why one should never make stuff from the raw-editor without prior checking
like, ever
2024-12-21 00:50:35 -03:00
dove
340ad4b812
like, ever 2024-12-21 00:44:53 -03:00
dove
254765b072
this is why one should never make stuff from the raw-editor without prior checking 2024-12-21 00:42:37 -03:00
dove
2558a339d7
woops² 2024-12-21 00:41:03 -03:00
dove
b07353383f
woops 2024-12-21 00:40:17 -03:00
dove
23e35dc851
also accept season and episode numbers for titles that support it 2024-12-21 00:39:07 -03:00
dove
626a901584
include additional parameters for video-session 2024-12-20 20:09:24 -03:00

View File

@ -1,9 +1,11 @@
import json
import re
import uuid
from .common import InfoExtractor
from ..utils import (
float_or_none,
int_or_none,
orderedSet,
str_or_none,
try_get,
@ -19,6 +21,8 @@ class GloboIE(InfoExtractor):
video(id: $videoId) {
duration
description
relatedEpisodeNumber
relatedSeasonNumber
headline
title {
originProgramId
@ -56,6 +60,31 @@ class GloboIE(InfoExtractor):
}, {
'url': 'globo:3607726',
'only_matching': True,
},
{
'url': 'globo:8013907', # needs subscription to globoplay
'info_dict': {
'id': '8013907',
'ext': 'mp4',
'title': 'Capítulo de 14081989',
'episode_number': 1,
},
'params': {
'skip_download': True,
},
},
{
'url': 'globo:12824146',
'info_dict': {
'id': '12824146',
'ext': 'mp4',
'title': 'Acordo de damas',
'episode_number': 1,
'season_number': 2,
},
'params': {
'skip_download': True,
},
}]
def _real_extract(self, url):
@ -84,7 +113,10 @@ class GloboIE(InfoExtractor):
'video_id': video_id,
'quality': 'max',
'content_protection': 'widevine',
'vsid': '2938bc7c-9376-d4b7-ee91-ce46dbbf9f4d',
'vsid': f'{uuid.uuid4()}',
'consumption': 'streaming',
'capabilities': {'low_latency': True},
'metadata': {'name': 'web', 'device': {'type': 'desktop', 'os': {}}},
'tz': '-03:00',
'Authorization': try_get(self._get_cookies('https://globo.com'),
lambda x: f'Bearer {x["GLBID"].value}') or '',
@ -109,6 +141,8 @@ class GloboIE(InfoExtractor):
'duration': ('duration', {float_or_none(scale=1000)}),
'uploader': ('title', 'headline', {str}),
'uploader_id': ('title', 'originProgramId', {str_or_none}),
'episode_number': ('relatedEpisodeNumber', {int_or_none}),
'season_number': ('relatedSeasonNumber', {int_or_none}),
}),
'formats': formats,
'subtitles': subtitles,