scrazzz / redgifs

Simple Python API wrapper for the RedGIFs API
https://redgifs.rtfd.io
MIT License
93 stars 13 forks source link

Difficulty in using link generated by get_gif(id) function with download(url,file_name) function #8

Closed CelebStalker closed 2 years ago

CelebStalker commented 2 years ago

URL given by get_gif(id) function unable to be used with download function. Screenshot 2022-09-10 192914

scrazzz commented 2 years ago

Hello, thanks for opening an issue to report this bug.

This seems like an API error with RedGifs. They stated in their documentation that you would receive a proper URL of their new change (See issue #7 and the official docs).

I'll let RedGifs know about this issue and will get back to you later.

scrazzz commented 2 years ago

A workaround for this right now is by replacing thumbs2 with thumbs3 in the URL.

from redgifs import API

api = API()
url = api.get_gif('simplefunctionalamericanwirehair').urls.hd

new_url = url.replace('thumbs2', 'thumbs3')
print(new_url)

api.download(new_url, 'vid.mp4')

Keep in mind that this may stop working at anytime.

sergeinaumoff commented 2 years ago

A workaround for this right now is by replacing thumbs2 with thumbs3 in the URL.

from redgifs import API

api = API()
url = api.get_gif('simplefunctionalamericanwirehair').urls.hd

new_url = url.replace('thumbs2', 'thumbs3')
print(new_url)

api.download(new_url, 'vid.mp4')

Keep in mind that this may stop working at anytime.

Thank you! I noticed that it possible to download video if use 'search' method and take 'thumbs4' URL with signature, for example from first element of Gifs. Unfortunately, it doesn't work if I get 'thumbs4' URL from page directly (using BeautifulSoup) and then try to use 'download' method.

CelebStalker commented 2 years ago

It probably has to do something with issue #7 Some kind of validation the website has introduced.

scrazzz commented 2 years ago

Looks like this issue has been fixed. You get the proper URL now and can use the download() method without any problem.

IMG