Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bunkr] fixed extractor #4529

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions gallery_dl/extractor/bunkr.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,16 @@ def fetch_album(self, album_id):
pos = page.index('class="grid-images')
for url in text.extract_iter(page, '<a href="', '"', pos):
if url.startswith("/"):
if not cdn:
# fetch cdn root from download page
durl = "{}/d/{}".format(self.root, url[3:])
# fetch cdn root from download page
durl = text.unescape("{}/{}/{}".format(
self.root, url[1], url[3:]))
if url[1] == 'v':
cdn = text.extr(self.request(
durl).text, 'link.href = "', '"')
cdn = cdn[:cdn.index("/", 8)]
url = cdn + url[2:]
durl).text, '<source src="', '"')
else:
cdn = text.extr(self.request(
durl).text, '<img src="', '"')
url = cdn

url = text.unescape(url)
if url.lower().endswith(CDN_HOSTED_EXTENSIONS):
Expand Down
Loading