Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Chyoa Download not working due to changes on the site #106

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Site/Chyoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def __init__(self, url):
self.temp[0]+='\n<br />'
self.epubtemp=self.temp.copy()
for i in soup.find('div', attrs={'class':'question-content'}).find_all('a'):
link= i.get_text()
if link.strip() != 'Add a new chapter':
link= i.get_text().strip()
if link not in ['Add a new chapter', 'Go into another direction with AI', 'Remove Ads', 'Manage Ad Settings']:

#Band aid fix for replaceable text in the next chapter links

Expand Down Expand Up @@ -436,8 +436,9 @@ def AddNextPage(self, args):
nextLinks=[]
temp+='<br />'
epubtemp=temp

for i in soup.find('div', attrs={'class':'question-content'}).find_all('a'):
if i.get_text().strip() != 'Add a new chapter':
if i.get_text().strip() not in ['Add a new chapter', 'Go into another direction with AI', 'Remove Ads', 'Manage Ad Settings']:
link = i.get_text()
#Band aid fix for replaceable text in the next chapter links
for l in range(len(self.renames)):
Expand Down Expand Up @@ -479,9 +480,9 @@ def AddNextPage(self, args):
#Other check if current page is a link and doesn't continue if so
prevLinkCheck1=soup.find('span', attrs={'class':'controls-left'})
prevLinkCheck2=prevLinkCheck1.find_all('a')[0].get('href')
prevLinkId1=urllib.parse.urlparse(prevLinkCheck2)[2].split('.')[2]
prevLinkId1=urllib.parse.urlparse(prevLinkCheck2)[2].split('.')[1]

currLinkId=urllib.parse.urlparse(url)[2].split('.')[2]
currLinkId=urllib.parse.urlparse(url)[2].split('.')[1]
if prevLinkId is not None and prevLinkId1 != prevLinkId:
#print(prevLinkId1)
#print(prevLinkId)
Expand Down Expand Up @@ -624,8 +625,7 @@ def AddNextPage(self, url, depth):


for i in soup.find('div', attrs={'class':'question-content'}).find_all('a'):
if i.get_text().strip() != 'Add a new chapter':

if i.get_text().strip() not in ['Add a new chapter', 'Go into another direction with AI', 'Remove Ads', 'Manage Ad Settings']:
link = i.get_text()
#Band aid fix for replaceable text in the next chapter links
for l in range(len(self.renames)):
Expand Down