'Getting 500 Internal Server Error from request
Long story short i'm making script for parsing sankakucomplex in search of pictures and downloading them. And everything until this function goes fine
def download_image_from_link(link, auth, number):
url = f"https:{link}"
bruh = requests.get(url)
with open(f"images/{auth}/image{number}.png", "wb") as im:
im.write(bruh.content)
{link} is something like //v.sankakucomplex.com/data/sample/a5/dc/sample-a5dcd9f21fc80b6bfe5acfa74c3bd936.jpg?e=1648321131&expires=1648321131&m=JqNaW8AUSE-G-jyihn0uiQ&token=hLsB-lYp7bQhgUbkLsZScpch1DBX6JQoFh4T-CglAKA
{auth} and {number} is not important
It just downloads all the puctires from array that i received from other inconsiderable in this situation functions.
And half of links to images starts with http://s. and other half is http://v.
So the thing is when it downloads http://v. files everything is fine, but in when it downloads http://s. it receives
b'<html>\r\n<head><title>500 Internal Server Error</title></head>\r\n<body>\r\n<center><h1>500 Internal Server Error</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n'
Here is the safest links that i could find if you need to check:
for //s. link
https://chan.sankakucomplex.com/ru/post/show/30856755
for //v. link (requests for //beta. doesnt work too)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
