mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-17 22:51:45 +00:00
[extractor/iwara] Report private videos (#6641)
Authored by: Lesmiscore
This commit is contained in:
parent
9be0fe1fd9
commit
95a383be1b
@ -4,6 +4,7 @@ import hashlib
|
||||
|
||||
from .common import InfoExtractor
|
||||
from ..utils import (
|
||||
ExtractorError,
|
||||
OnDemandPagedList,
|
||||
int_or_none,
|
||||
mimetype2ext,
|
||||
@ -75,7 +76,13 @@ class IwaraIE(InfoExtractor):
|
||||
|
||||
def _real_extract(self, url):
|
||||
video_id = self._match_id(url)
|
||||
video_data = self._download_json(f'http://api.iwara.tv/video/{video_id}', video_id)
|
||||
video_data = self._download_json(f'http://api.iwara.tv/video/{video_id}', video_id, expected_status=lambda x: True)
|
||||
errmsg = video_data.get('message')
|
||||
# at this point we can actually get uploaded user info, but do we need it?
|
||||
if errmsg == 'errors.privateVideo':
|
||||
self.raise_login_required('Private video. Login if you have permissions to watch')
|
||||
elif errmsg:
|
||||
raise ExtractorError(f'Iwara says: {errmsg}')
|
||||
|
||||
return {
|
||||
'id': video_id,
|
||||
|
Loading…
Reference in New Issue
Block a user