Overview
The website I'm using is Gogoanime, which allows users to watch and download anime. I want to automate the download process. It's also worth noting that I'm only making this for personal use.
! PLEASE HAVE AN AD BLOCKER BEFORE CLICKING ANY OF THE LINKS !
Here's the website --> https://www2.gogoanime.cm/ Here's a an episode example -- > https://www2.gogoanime.cm/death-note-dub-episode-1
Each episode has a download button. This is the download page for the above episode. -- > https://gogoplay1.com/download?id=OTA3OTk=&typesub=Gogoanime-DUB&title=Death+Note+%28Dub%29+Episode+1
If you click on any of the link downloads, the episode will start downloading. The download will also start if you select "save link as". However, there will be a 403 error if you paste the link into a new tab. I've already been able to scrape these links, but I can't download them through Python. It seems like these link downloads are from "vidstreaming", which was later renamed to gogoplay1 --> https://gogoplay1.com/.
I've tried many things, such as fake user agents, modifying cookies, and using cloudflare, but every time I request the download link, I'm hit with a 403 forbidden error.
It's also worth noting that this package -- > https://pythonrepo.com/repo/BaraniARR-anikimiapi-python-third-party-apis-wrappers, while is currently broken, mentions something regarding "tokens". I spent a very long time going over the code, but I can't get the tokens to help me.
I read somewhere that I needed to be authenticated into some servers, but I couldn't find the authentication type for gogoanime or gogoplay1.
Minimum reproducible example:
Here is one of the described download links -- > https://gogo-cdn.com/download.php?url=aHR0cHM6LyAawehyfcghysfdsDGDYdgdsfsdfwstdgdsgtert9AdrefsdsdfwerFrefdsfrersfdsrfer36343534jZG41LmFuaWNkbi5zdHJlYW0vdXNlcjEzNDIvN2ZjZmYzYzBkYjgxNWQ5MTIzNzI1MzA3MWI3ZTc0NzIvRVAuMS52MC4xNjM5MTc0MzgyLjcyMHAubXA0P3Rva2VuPVdIRVVaOUVjd0lJLU9iUXAwcGhXTXcmZXhwaXJlcz0xNjQxMjcyNDA4JmlkPTkwNzk5
You can run this code for more (of different quality)
import requests_html
url = "https://gogoplay1.com/download?id=OTA3OTk=&typesub=Gogoanime-DUB&title=Death+Note+%28Dub%29+Episode+1"
session = requests_html.HTMLSession()
response = session.get(url)
links = response.html.absolute_links
for link in links:
if "gogo-cdn" in link:
print(link)
Here's the code that fails to download from the link.
from fake_useragent import UserAgent
import cloudscraper
import requests
url = "https://gogo-cdn.com/download.php?url=aHR0cHM6LyAawehyfcghysfdsDGDYdgdsfsdfwstdgdsgtert9AdrefsdsdfwerFrefdsfrersfdsrfer36343534jZG41LmFuaWNkbi5zdHJlYW0vdXNlcjEzNDIvN2ZjZmYzYzBkYjgxNWQ5MTIzNzI1MzA3MWI3ZTc0NzIvRVAuMS52MC4xNjM5MTc0MzgyLjcyMHAubXA0P3Rva2VuPVdIRVVaOUVjd0lJLU9iUXAwcGhXTXcmZXhwaXJlcz0xNjQxMjcyNDA4JmlkPTkwNzk5"
my_session = cloudscraper.create_scraper()
for_cookies = my_session.get("https://www.gogoplay1.com/") #don't know whether to use gogoanime or gogoplay1
cookies = for_cookies.cookies
response = my_session.get(url, headers={"User-Agent":UserAgent().chrome}, cookies=cookies)
print(response.status_code)
Lastly, I should mention that I have a decent grasp on Python, but next to none when it comes to scraping/web stuff. So, jargon and complicated processes might go right over my head. Thanks for reading this long post and thanks in advance for any help.