[pixiv] fix ugoira extraction ... again (#78)

Some animations are not available for mobile devices, so we
pretend to be a desktop browser when requesting the ugoira page.
This commit is contained in:
Mike Fährmann 2018-02-19 16:50:12 +01:00
parent b79f1f2ca7
commit 367b963d37
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,7 @@
# Changelog
## Unreleased
- Fixed extraction issues for `mangastream`
- Fixed extraction issues for `mangastream` and `pixiv`
## 1.2.0 - 2018-02-16
- Added support for:

View File

@ -71,12 +71,13 @@ class PixivExtractor(Extractor):
"""Parse ugoira data"""
# get illust page
page = self.request(
self.illust_url, params={"illust_id": data["id"]},
self.illust_url,
params={"illust_id": data["id"]},
headers={"User-Agent": "Mozilla/5.0"},
).text
# parse page
meta = text.extract(page, ' data-meta="', '"')[0]
frames = text.extract(text.unescape(meta), ',"frames":[', ']')[0]
frames = text.extract(page, ',"frames":[', ']')[0]
# build url
url = re.sub(