HoverHell / RedditImageGrab

Downloads images from sub-reddits of reddit.com.
GNU General Public License v3.0
311 stars 78 forks source link

HTTP Error 403: Forbidden #54

Closed roperi closed 8 years ago

roperi commented 8 years ago

I'm getting quite a lot of these:

Attempting to download URL[https://i.redd.it/u9gxuiais.png] as [8912hkads.png].
Try 0 err HTTPError()  (u'https://i.redd.it/u9gxuiais.png')
Try 1 err HTTPError()  (u'https://i.redd.it/u9gxuiais.png')
Try 2 err HTTPError()  (u'https://i.redd.it/u9gxuiais.png')
    HTTP Error 403: Forbidden

I tried pausing 10 seconds (time.sleep(10)) between tries but still I get the 403. Any thoughts?

rachmadaniHaryono commented 8 years ago

this and #55 caused because this program don't have the parser for that domain. and also there is possibilty that redd.it domain require cookies or other data to be sent before downloading the image.

roperi commented 8 years ago

Thanks, @rachmadaniHaryono

Could it be related to Parse redd.it ?

rachmadaniHaryono commented 8 years ago

Yes. Other than getting request like @maxpowa,other option is to use selenium with phantomjs ,so the browser can handle the request

roperi commented 8 years ago

@rachmadaniHaryono

I followed the maxpowa lead and installed the following request dependencies (from Python 2.7.9) to see if it had to do:

pip install urllib3
pip install pyopenssl
pip install ndg-httpsclient
pip install pyasn1

Unfortunately didn't resolve the issue.

rachmadaniHaryono commented 8 years ago

hi i have made pull request for this issue and the #55 . it need requests library

tell me if there is any error. :)

roperi commented 8 years ago

@rachmadaniHaryono

It works! I didn't find any error! Thanks so much!

rachmadaniHaryono commented 8 years ago

i'm glad it is worked. maybe you can close #55, so @HoverHell can just accept the related pull request and close one issue.

i see in my home timeline this comments from yours

Perhaps I need to clone/install your fork and then try to update your pull request fix? But if so, it looks your fork is for python 3. I am using p…

Now I see it is only one file, right? (redditupload.py). Because if that's the case I should need to copy+paste the entire content of it and import…

if you use python27, you can install from my branch with pip

[sudo] pip install https://github.com/rachmadaniHaryono/RedditImageGrab/archive/master.zip

if you use python3 i will try to merge it with @jtara1 fork.

roperi commented 8 years ago

@rachmadaniHaryono Again, Many thanks!