Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Commit

Permalink
Update backend.py
Browse files Browse the repository at this point in the history
Update web address
  • Loading branch information
Arctic4161 committed May 14, 2024
1 parent 9a46148 commit 0a1f8eb
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ class gogoanime:
def get_gogoanime_auth_cookie(self):
session = requests.session()
page = session.get(
f"https://gogoanime.{self.config['CurrentGoGoAnimeDomain']}/login.html"
f"https://{self.config['CurrentGoGoAnimeDomain']}/login.html"
)
soup = BeautifulSoup(page.content, "html.parser")
meta_path = soup.select('meta[name="csrf-token"]')
csrf_token = meta_path[0].attrs["content"]

url = f"https://gogoanime.{self.config['CurrentGoGoAnimeDomain']}/login.html"
url = f"https://{self.config['CurrentGoGoAnimeDomain']}/login.html"
payload = f"email={self.config['GoGoAnime_Username']}&password={self.config['GoGoAnime_Password']}&_csrf={csrf_token}"
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36",
"authority": "gogo-cdn.com",
"referer": f"https://gogoanime.{self.config['CurrentGoGoAnimeDomain']}/",
"referer": f"https://{self.config['CurrentGoGoAnimeDomain']}/",
"content-type": "application/x-www-form-urlencoded",
}
session.headers = headers
Expand All @@ -128,7 +128,7 @@ def user_logged_in_check(
self,
):
page = requests.get(
f"https://gogoanime.{self.config['CurrentGoGoAnimeDomain']}/one-piece-episode-1",
f"https://{self.config['CurrentGoGoAnimeDomain']}/one-piece-episode-1",
cookies=dict(auth=gogoanime.get_gogoanime_auth_cookie(self)),
)
soup = BeautifulSoup(page.content, "html.parser")
Expand All @@ -137,7 +137,7 @@ def user_logged_in_check(
raise CustomMessage.user_not_logged_in()

def get_links(self, source=None):
source_ep = f"https://gogoanime.{self.config['CurrentGoGoAnimeDomain']}/{self.name}-episode-"
source_ep = f"https://{self.config['CurrentGoGoAnimeDomain']}/{self.name}-episode-"
episode_links = [
f"{source_ep}{i}"
for i in range(self.episode_start, self.episode_end + 1)
Expand Down Expand Up @@ -201,7 +201,7 @@ def get_show_from_bookmark(self):
bookmarkList = []
a = dict(auth=gogoanime.get_gogoanime_auth_cookie(self))
resp = requests.get(
f"https://gogoanime.{self.config['CurrentGoGoAnimeDomain']}/user/bookmark",
f"https://{self.config['CurrentGoGoAnimeDomain']}/user/bookmark",
cookies=a,
)
soup = BeautifulSoup(resp.text, "html.parser")
Expand All @@ -225,7 +225,7 @@ def get_show_from_bookmark(self):
{
"showName": animeName,
"latestEpisode": int(episodeNum),
"downloadURL": f"https://gogoanime.{self.config['CurrentGoGoAnimeDomain']}/{animeDownloadName}-episode-{str(episodeNum)}",
"downloadURL": f"https://{self.config['CurrentGoGoAnimeDomain']}/{animeDownloadName}-episode-{str(episodeNum)}",
}
)
with open("bookmarkList.json", "w") as f:
Expand Down

0 comments on commit 0a1f8eb

Please sign in to comment.