Browse Source

[ie/picarto] Fix extractors (#10414)

Closes #10413
Authored by: Frankgoji
Franklin Lee 8 months ago
parent
commit
bacd18b7df
1 changed files with 9 additions and 7 deletions
  1. 9 7
      yt_dlp/extractor/picarto.py

+ 9 - 7
yt_dlp/extractor/picarto.py

@@ -5,6 +5,7 @@ from ..utils import (
     ExtractorError,
     str_or_none,
     traverse_obj,
+    update_url,
 )
 
 
@@ -43,15 +44,16 @@ class PicartoIE(InfoExtractor):
     url
   }
 }''' % (channel_id, channel_id),  # noqa: UP031
-            })['data']
+            }, headers={'Accept': '*/*', 'Content-Type': 'application/json'})['data']
         metadata = data['channel']
 
         if metadata.get('online') == 0:
             raise ExtractorError('Stream is offline', expected=True)
         title = metadata['title']
 
-        cdn_data = self._download_json(
-            data['getLoadBalancerUrl']['url'] + '/stream/json_' + metadata['stream_name'] + '.js',
+        cdn_data = self._download_json(''.join((
+            update_url(data['getLoadBalancerUrl']['url'], scheme='https'),
+            '/stream/json_', metadata['stream_name'], '.js')),
             channel_id, 'Downloading load balancing info')
 
         formats = []
@@ -99,10 +101,10 @@ class PicartoVodIE(InfoExtractor):
         },
         'skip': 'The VOD does not exist',
     }, {
-        'url': 'https://picarto.tv/ArtofZod/videos/772650',
-        'md5': '00067a0889f1f6869cc512e3e79c521b',
+        'url': 'https://picarto.tv/ArtofZod/videos/771008',
+        'md5': 'abef5322f2700d967720c4c6754b2a34',
         'info_dict': {
-            'id': '772650',
+            'id': '771008',
             'ext': 'mp4',
             'title': 'Art of Zod - Drawing and Painting',
             'thumbnail': r're:^https?://.*\.jpg',
@@ -131,7 +133,7 @@ class PicartoVodIE(InfoExtractor):
     }}
   }}
 }}''',
-            })['data']['video']
+            }, headers={'Accept': '*/*', 'Content-Type': 'application/json'})['data']['video']
 
         file_name = data['file_name']
         netloc = urllib.parse.urlparse(data['video_recording_image_url']).netloc