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

It's possible to avoid some pointless deviantart avatar requests #5276

Closed
Twi-Hard opened this issue Mar 4, 2024 · 4 comments
Closed

It's possible to avoid some pointless deviantart avatar requests #5276

Twi-Hard opened this issue Mar 4, 2024 · 4 comments

Comments

@Twi-Hard
Copy link

Twi-Hard commented Mar 4, 2024

If ?https://a.deviantart.net/avatars/default.gif is appended to an avatar url then it will have no avatar. I've tested many manually and every attempt shown in the logs 404. I already have 5000 lines in my logs that match ?https://a.deviantart.net/avatars/default.gif and I just started. It should save a lot of time and requests if gallery-dl didn't try to download these links. It's not super important I guess but I thought I should mention it. :)

2024-03-03 16:46:47 debug: https://a.deviantart.net:443 "GET /avatars-big/s/p/spunmetal.gif?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:47 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars-big/s/p/spunmetal.gif?https://a.deviantart.net/avatars/default.gif'
2024-03-03 16:46:48 debug: https://a.deviantart.net:443 "GET /avatars/s/p/spunmetal.gif?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:48 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars/s/p/spunmetal.gif?https://a.deviantart.net/avatars/default.gif'
2024-03-03 16:46:49 debug: https://a.deviantart.net:443 "GET /avatars-original/t/h/thatantifurr.png?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:49 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars-original/t/h/thatantifurr.png?https://a.deviantart.net/avatars/default.gif'
2024-03-03 16:46:50 debug: https://a.deviantart.net:443 "GET /avatars-big/t/h/thatantifurr.png?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:50 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars-big/t/h/thatantifurr.png?https://a.deviantart.net/avatars/default.gif'
2024-03-03 16:46:50 debug: https://a.deviantart.net:443 "GET /avatars/t/h/thatantifurr.png?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:50 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars/t/h/thatantifurr.png?https://a.deviantart.net/avatars/default.gif'
2024-03-03 16:46:50 debug: https://a.deviantart.net:443 "GET /avatars-original/t/h/thatantifurr.jpg?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:50 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars-original/t/h/thatantifurr.jpg?https://a.deviantart.net/avatars/default.gif'
2024-03-03 16:46:51 debug: https://a.deviantart.net:443 "GET /avatars-big/t/h/thatantifurr.jpg?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:51 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars-big/t/h/thatantifurr.jpg?https://a.deviantart.net/avatars/default.gif'
2024-03-03 16:46:51 debug: https://a.deviantart.net:443 "GET /avatars/t/h/thatantifurr.jpg?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:51 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars/t/h/thatantifurr.jpg?https://a.deviantart.net/avatars/default.gif'
2024-03-03 16:46:52 debug: https://a.deviantart.net:443 "GET /avatars-original/t/h/thatantifurr.gif?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:52 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars-original/t/h/thatantifurr.gif?https://a.deviantart.net/avatars/default.gif'
2024-03-03 16:46:52 debug: https://a.deviantart.net:443 "GET /avatars-big/t/h/thatantifurr.gif?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:52 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars-big/t/h/thatantifurr.gif?https://a.deviantart.net/avatars/default.gif'
2024-03-03 16:46:52 debug: https://a.deviantart.net:443 "GET /avatars/t/h/thatantifurr.gif?https://a.deviantart.net/avatars/default.gif HTTP/1.1" 404 4822
2024-03-03 16:46:52 Warning: '404 Not Found' for 'https://a.deviantart.net/avatars/t/h/thatantifurr.gif?https://a.deviantart.net/avatars/default.gif'

Edit: When I did testing with avatars in the past, anything after the ? didn't seem to matter at all so maybe the ? and everything after it should be removed?

@mikf
Copy link
Owner

mikf commented Mar 4, 2024

The part after the ? is supposed to just be the avatar index number, e.g. 4 for https://a.deviantart.net/avatars-big/s/h/shimoda7.jpg?4, but the current code seems to put the entire URL there.

Some questions:

  • should default avatars get ignored or do you want to download them?
  • should users with default avatars still go through all possible avatar formats?
    (https://a.deviantart.net/avatars/t/h/thatantifurr.gif etc, even though this user has a default avatar)

@mikf mikf added the site:bug label Mar 4, 2024
@Twi-Hard
Copy link
Author

Twi-Hard commented Mar 4, 2024

According to the logs, none of the formats/sizes succeded when ?https://a.deviantart.net/avatars/default.gif was in the URL. The default avatar shouldn't be downloaded for sure. There's only 1 and it's easy to get manually. The default avatar can be in different sizes for different users for some reason so it would still take potentially multiple requests per user that didn't upload a custom pic (which is a huge percentage of them).

@Twi-Hard
Copy link
Author

Twi-Hard commented Mar 4, 2024

When I did my testing in the past I downloaded every format/size combination without the ? and the stuff after it by using the list of usernames to recreate the avatar urls with a script. For some reason it was downloading default avatars using those recreated links sometimes (not the regular default avatar url we're seeing after the ?). So I'm thinking it's possible to run into the default avatar on some users anyways? By that I mean the normal avatar urls can contain the default avatar without us knowing it's not a custom one potentially? If so I'm not sure how gallery-dl could detect that (unless if that only happened on accounts where gallery-dl would have put ?https://a.deviantart.net/avatars/default.gif in the URL so the default avatars with normal avatar urls would be skipped anyways once not attempting to download avatars if ?https://a.deviantart.net/avatars/default.gif is in the URL is implemented).

Hopefully I didn't say that too confusingly

Edit: this post gives context to what I meant by the default avatars can be different sizes for different users.

@mikf
Copy link
Owner

mikf commented Mar 5, 2024

The bug with putting the entire URL after ? is fixed (0cbc910)
and default avatars now get ignored (a767832).

Let me know if you have any other problems in this regard or close this issue otherwise.

@mikf mikf closed this as completed Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants