mirror of
https://github.com/karl0ss/GoGoDownloader.git
synced 2025-04-26 11:39:22 +01:00
get_show_from_bookmark
This commit is contained in:
parent
a09ed8c802
commit
64acd0abb2
34
backend.py
34
backend.py
@ -213,6 +213,40 @@ class gogoanime:
|
||||
files = dl.download()
|
||||
return files
|
||||
|
||||
def get_show_from_bookmark(self):
|
||||
bookmarkList = []
|
||||
a = dict(auth=gogoanime.get_gogoanime_auth_cookie(self))
|
||||
resp = requests.get(
|
||||
"https://gogoanime.gg/user/bookmark",
|
||||
cookies=a,
|
||||
)
|
||||
soup = BeautifulSoup(resp.text, "html.parser")
|
||||
table = soup.find("div", attrs={"class": "article_bookmark"})
|
||||
splitTableLines = table.text.split("Remove")
|
||||
for rows in splitTableLines:
|
||||
fullRow = " ".join(rows.split())
|
||||
if "Anime name" in fullRow:
|
||||
fullRow = fullRow.replace("Anime name Latest", "")
|
||||
splitRow = fullRow.split("Latest")
|
||||
elif fullRow == "Status":
|
||||
break
|
||||
else:
|
||||
fullRow = fullRow.replace("Status ", "")
|
||||
splitRow = fullRow.split("Latest")
|
||||
animeName = splitRow[0].strip()
|
||||
animeDownloadName = animeName.replace(":", "").replace(" ", "-").lower()
|
||||
episodeNum = splitRow[-1].split()[-1]
|
||||
bookmarkList.append(
|
||||
{
|
||||
"showName": animeName,
|
||||
"latestEpisode": int(episodeNum),
|
||||
"downloadURL": f"https://gogoanime.{self.config['CurrentGoGoAnimeDomain']}/{animeDownloadName}-episode-{str(episodeNum)}",
|
||||
}
|
||||
)
|
||||
with open("bookmarkList.json", "w") as f:
|
||||
json.dump(bookmarkList, f)
|
||||
return bookmarkList
|
||||
|
||||
|
||||
@dataclass(init=True)
|
||||
class CustomMessage(Exception):
|
||||
|
Loading…
x
Reference in New Issue
Block a user