-
Notifications
You must be signed in to change notification settings - Fork 59
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
Added traceback if the urlretrive fails, folder naming, topic download support and fixed doube download bug #26
base: master
Are you sure you want to change the base?
Conversation
imguralbum.py
Outdated
@@ -158,7 +159,7 @@ def save_images(self, foldername=False): | |||
try: | |||
urllib.request.urlretrieve(image_url, path) | |||
except: | |||
print ("Download failed.") | |||
print ("Download failed.\n"+format_exc()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be traceback.print_exc()
? (https://docs.python.org/3/library/traceback.html)
updating from original
Creating directories with the same name as the album is a bit problematic because album name may contain characters that are restricted by OS and naming folders with them would cause errors. I overcome this problem by replacing any special characters with `space`
All because imgur source changed again!
This reverts commit 7c52651.
Now program will save files into folders named after album names. If this is undesired folders can be named by their ID like this: args = sys.argv downloader = ImgurAlbumDownloader(args[1]) downloader.save_images(downloader.album_key)
It errors out with
When downloading NSFWThisNFSW |
Another pesky imgur front-end update!
@cyian-1756 Hey, thanks for the insight. It should be all good now. |
@szero Your version can run into issues if it can't find the album name, you might want to check out falling back to the old version naming (The album ID) in that case.
|
Could you include link to the image that caused no album match? On 31/07/16 04:08, cyian-1756 wrote:
|
@cyian-1756 Thanks for the input. I adjusted this for your suggestions. |
@szero I've noticed that if 2 albums have the same name this will put all the downloaded pictures from both albums into one folder, wouldn't it be better (at least for archivers) to add the album ID to the folder if a folder with the same name already exists? |
@cyian-1756 I added option that names downloaded albums after their ID's. just use it like that: |
Hi, you pulled me over from the other thread on imgur album downloader. How does this one fix urls not working? I tried in terminal "python3 [imgur-album-downloader-master in the right location.py] https://imgur.com/gallery/wfMp9 ~/desktop" and it told me something similar/the-same-as-the-original-version-of-this-program "response_code = e.code |
- Better error handling on urlopen method - Added property decorators to 4 methods - Refactored some code according to pylint
Hello again, @Coaggly. The stack trace indicates that it is some sort of URL error that wasn't handled properly before. I updated the code so it has more verbose output now. It can be caused by outdated certificates on your system, or something trivial like lack of internet connection. If you are using some Linux-based system, try updating the package lists and upgrade your packages. The package you would be looking to upgrade if it would be the case of the issue is |
@szero I'm on mac. I tried updating, same thing. I'm not using homebrew if that makes a difference? I'm really new to this stuff so i don't know if i should be |
Are you sure you are running my version? You shouldn't get the same error this time. Please upload full error trace and your python3 version if possible. |
I must apologize, but google isn't telling me how to get the error trace. I don't suppose you know a good basic tutorial for python that includes something about trace errors? The ones i watched didn't mention much about error trace. "Python 3.6.3" |
By error trace I just meant what program prints after you run it, it can't be same error this time. Please download my release from here: https://github.com/Szero/imgur-album-downloader/archive/master.zip and try again. |
Here's a link to my fork of this program: https://github.com/Szero/imgur-album-downloader
Added error feedback if the urlretrive fails to download requested in #24