-
-
Notifications
You must be signed in to change notification settings - Fork 975
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
Can't download vk.com albums now #2512
Comments
It looks removing Anyway today VK have changed the image endpoints. It was:
Now:
|
Currently having the same problem. I know the solution is to parse the last three parameters (size, quality and type) then concatenate it back to the image_url, but I don't know the in and outs of the source code since i'm just a average enjoyer here in github. Really hope the devs will fix it. |
I wonder if it possible to make changes to gallery-dl so it would parse it correct? |
After hours of scrubbing through the source code, was able to debug and download some images at super low quality since the album where it is fetching has a fixed width and height.
Here's the div where the photos are being fetched. Initially, the part size=200x313&quality=95&type=album is omitted by the source code and working fine, but as what AlttiRi said, vk change it's image end point and omitting the last parameters is now no longer working. Edit:
|
(Without using VK API) UPD. let {payload: [_zero, [list, total, offset, images, _extra]]} = JSON.parse(new TextDecoder("windows-1251").decode(await (await fetch("https://vk.com/al_photos.php?act=show", {
"headers": {
"content-type": "application/x-www-form-urlencoded",
"x-requested-with": "XMLHttpRequest"
},
"body": "act=show&al=1&direction=1&list=album-29937425_0&offset=0", // -159293555_272628467 NSFW
"method": "POST",
})).arrayBuffer()));
console.log({list, total, offset, images}); It returns info for 10 images. Then you need to find a url with bigger image dimensions Image types (from bigger to lower size): Note: vk.com returns answers with Upd 2022.04.22: BTW, the rendered HTML is not convenient to use, so it's possible to parse the original text this way: import xml.dom.minidom
def getText(nodelist):
rc = []
for node in nodelist:
if node.nodeType == node.TEXT_NODE:
rc.append(node.data)
return "".join(rc)
author = '<a href="/cosplayinrussia" class="group_link">Косплей | Cosplay 18+</a>'
date = '<span class="rel_date">8 Jun 2021</span>'
a = xml.dom.minidom.parseString(author).getElementsByTagName("a")[0]
s = xml.dom.minidom.parseString(date).getElementsByTagName("span")[0]
authorText = getText(a.childNodes)
dateText = getText(s.childNodes)
print(authorText) # Косплей | Cosplay 18+
print(dateText) # 8 Jun 2021 |
Use a different API endpoint, since thumbnail URLs from the old one cannot be transformed into URLs for "original" photos anymore.
so is not possible anymore to get the original size images? |
I don't think that it was possible to download the "original" uploaded images before. As far as I know VK always re-encodes images/videos even if the result's size will be larger. |
Hi. I used to download vk.com albums with gallery-dl some time ago, but now it seems something went wrong and I'm unable to do it. Can you please shed some light on what's going on? gallery-dl installed on macOS 10.13.6 via $ python3 -m pip install -U gallery-d
l
The text was updated successfully, but these errors were encountered: