Skip to content

Commit

Permalink
[vvvvid] reduce season request payload size
Browse files Browse the repository at this point in the history
  • Loading branch information
remitamine committed Feb 24, 2021
1 parent 9662e49 commit ef28e33
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions youtube_dl/extractor/vvvvid.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@ def _real_initialize(self):
'https://www.vvvvid.it/user/login',
None, headers=self.geo_verification_headers())['data']['conn_id']

def _download_info(self, show_id, path, video_id, fatal=True):
def _download_info(self, show_id, path, video_id, fatal=True, query=None):
q = {
'conn_id': self._conn_id,
}
if query:
q.update(query)
response = self._download_json(
'https://www.vvvvid.it/vvvvid/ondemand/%s/%s' % (show_id, path),
video_id, headers=self.geo_verification_headers(), query={
'conn_id': self._conn_id,
}, fatal=fatal)
video_id, headers=self.geo_verification_headers(), query=q, fatal=fatal)
if not (response or fatal):
return
if response.get('result') == 'error':
Expand All @@ -98,7 +101,8 @@ def _real_extract(self, url):
show_id, season_id, video_id = re.match(self._VALID_URL, url).groups()

response = self._download_info(
show_id, 'season/%s' % season_id, video_id)
show_id, 'season/%s' % season_id,
video_id, query={'video_id': video_id})

vid = int(video_id)
video_data = list(filter(
Expand Down

0 comments on commit ef28e33

Please sign in to comment.