-# coding: utf-8
-from __future__ import unicode_literals
-
import json
from .common import InfoExtractor
'Authorization': 'Bearer ' + self._token,
}, query=query)
- def _real_initialize(self):
- email, password = self._get_login_info()
- if email is None:
- self.raise_login_required()
-
+ def _perform_login(self, username, password):
req = PUTRequest(
'https://api.playplus.tv/api/web/login', json.dumps({
- 'email': email,
+ 'email': username,
'password': password,
}).encode(), {
'Content-Type': 'application/json; charset=utf-8',
self._profile = self._call_api('Profiles')['list'][0]['_id']
+ def _real_initialize(self):
+ if not self._token:
+ self.raise_login_required(method='password')
+
def _real_extract(self, url):
project_id, media_id = self._match_valid_url(url).groups()
media = self._call_api(
'width': int_or_none(file_info.get('width')),
'height': int_or_none(file_info.get('height')),
})
- self._sort_formats(formats)
thumbnails = []
for thumb in media.get('thumbs', []):