alexgisby / imgur-album-downloader

Python script/class to download an entire Imgur album in one go into a folder of your choice.
MIT License
340 stars 59 forks source link

Added traceback if the urlretrive fails, folder naming, topic download support and fixed doube download bug #26

Open szero opened 8 years ago

szero commented 8 years ago

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

szero commented 8 years ago

Added folder naming requested in #27 in commit [ 71744f1]

szero commented 8 years ago

Added downloading from topics requested in #30 in commit [7c52651]

szero commented 8 years ago

Fixed double download bug requested in #31 in commit [7c52651]

cyian-1756 commented 8 years ago

It errors out with

File "imguralbum.py", line 200, in <module> downloader = ImgurAlbumDownloader(args[1]) File "imguralbum.py", line 83, in __init__ self.album_title = re.search('image\s*:\s*{"id":"%s","title":"(.*?)"' % self.album_key ,html).group(1) AttributeError: 'NoneType' object has no attribute 'group'

When downloading NSFWThisNFSW

szero commented 8 years ago

@cyian-1756 Hey, thanks for the insight. It should be all good now.

cyian-1756 commented 8 years ago

@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.

Traceback (most recent call last): File "/home/user/imgur-album-downloader", line 226, in <module> downloader.save_images(albumFolder) File "/home/user/imgur-album-downloader", line 158, in save_images os.makedirs(albumFolder) File "/usr/lib/python3.5/os.py", line 241, in makedirs mkdir(name, mode) FileNotFoundError: [Errno 2] No such file or directory: ''

szero commented 8 years ago

Could you include link to the image that caused no album match?

On 31/07/16 04:08, cyian-1756 wrote:

@Szero https://github.com/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.

|Traceback (most recent call last): File "/home/user/imgur-album-downloader", line 226, in downloader.save_images(albumFolder) File "/home/user/imgur-album-downloader", line 158, in save_images os.makedirs(albumFolder) File "/usr/lib/python3.5/os.py", line 241, in makedirs mkdir(name, mode) FileNotFoundError: [Errno 2] No such file or directory: ''|

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alexgisby/imgur-album-downloader/pull/26#issuecomment-236403329, or mute the thread https://github.com/notifications/unsubscribe-auth/APBPc7YByO12Cus_KVTrhjkTKRkslQSHks5qbAONgaJpZM4IDNl1.

cyian-1756 commented 8 years ago

@Szero It was NSFW This NSFW.

szero commented 8 years ago

@cyian-1756 Thanks for the input. I adjusted this for your suggestions.

cyian-1756 commented 7 years ago

@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?

szero commented 7 years ago

@cyian-1756 I added option that names downloaded albums after their ID's. just use it like that: ./imguralbum.py [URL] --use-ids It will name albums after their ID. Making it automated like you suggests it's not good because if album names are the same that usually means they are the same albums on imgur and it would result in downloading same album twice. Cheers.

ghost commented 6 years ago

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 AttributeError: 'URLError' object has no attribute 'code' "

szero commented 6 years ago

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 ca-certificates on most distros.

ghost commented 6 years ago

@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

szero commented 6 years ago

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.

ghost commented 6 years ago

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"

szero commented 6 years ago

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.