genious7 / FanFictionReader

An android app that improves browsing Fan Fiction stories on a mobile device
GNU General Public License v3.0
56 stars 24 forks source link

Error when opening new story #84

Open slenderknight1 opened 2 years ago

slenderknight1 commented 2 years ago

When opening a new story i get no words and it says 1-1 chapters when in bio it says 20

SilentProwler commented 2 years ago

Same thing is happening to me :/ Tho its also preventing me from updating fics

genious7 commented 2 years ago

Hi,

I can confirm the problem. The problem is caused by another CloudFlare security screen that the FanFiction.net staff added to their website to block unofficial apps like this one, as shown in the image below. (Try opening any story on an incognito tab in a browser and you'll see that screen)

The app doesn't know what to do with that and freezes, resulting in the empty screen you are seeing.

I'll look into the issue, but I recommend you to consider migrating to the official app on the short term. Cloudflare's job is to block apps like this one, and it is exceedingly difficult to bypass (else there wouldn't be a point to it).

image

SilentProwler commented 2 years ago

Out of curiosity, how hard would it be to add a log in feature to the app? I imagine if we log into FFN in the browser-not-browser, the cloudflare check would be disabled I imagine (unless thats not the case, of course)

Beck-919 commented 2 years ago

@genious7, one thing I would request is some way to properly download/convert all the fics to pdfs or something. Around 10% of the fics in my collection is not there in the website anymore.

hallowknight99 commented 2 years ago

@genious7, one thing I would request is some way to properly download/convert all the fics to pdfs or something. Around 10% of the fics in my collection is not there in the website anymore.

Same plus I have 2155 download. I have managed to export the list but need a better way to add them instead of adding 1 at a time

Lady-Awinita commented 2 years ago

Oh gfood, so its being worked on, I tried updating a direct story, and it gave me the notice "Error downloading story; please contact developer" right on my device, it's never said that before.

I personally concluded that it is a result of the cloudflare browser check, it seems to happen every 6 hours or so to me now

gnarlin commented 2 years ago

I tried the official fanfiction.net app. It sucked. Yours is much better. If there's any chance for it to work again I'd prefer to use it.

canerolu2019 commented 2 years ago

Hi,

I can confirm the problem. The problem is caused by another CloudFlare security screen that the FanFiction.net staff added to their website to block unofficial apps like this one, as shown in the image below. (Try opening any story on an incognito tab in a browser and you'll see that screen)

The app doesn't know what to do with that and freezes, resulting in the empty screen you are seeing.

I'll look into the issue, but I recommend you to consider migrating to the official app on the short term. Cloudflare's job is to block apps like this one, and it is exceedingly difficult to bypass (else there wouldn't be a point to it).

image

@genious7 Im sure there will be some way you can manage to find a fix. Dont give up we believe in you. Also if you need any new ideas regarding on how to bypass the cloudflare i can give you some ideas.First i found something like a Cloudflare bypasser or some sort. Idk if this can come in handy for you. heres the page. https://github.com/Anorov/cloudflare-scrape. If this doent work then you can try also this https://github.com/yottaiq/CloudAttack . Hope this helps.

canerolu2019 commented 2 years ago

I tried the official fanfiction.net app. It sucked. Yours is much better. If there's any chance for it to work again I'd prefer to use it.

One time i also used their app before. Its bad. I prefer this one.

Lady-Awinita commented 2 years ago

As time goes on they further refine the app. What used to really eat the battery is actually much lighter on the battery use. But nothing beats Fanfiction Reader. the stupid browser check from cloudflare though is making me leave fanfiction.net and go to Proboards to host my stories

canerolu2019 commented 2 years ago

They really fucked it up this time. Those morons from fanfiction staff. I hope genious can find a fix to this.

lightningHoneypot commented 2 years ago

Is there anyway we can help? Where to start looking?

Beck-919 commented 2 years ago

@genious7, as @lightningHoneypot mentioned if you want some research done let us know. Don't have any experience with app development but can explore material on this if you can point me in the right direction.

genious7 commented 2 years ago

Hi,

Thanks for the support. Unfortunately, I won't be able to look into the issue until mid-december due to work.

Truth to be told, there's not much to research per se, particularily if you've never programmed javascript before.

The only way to bypass the Cloudflare screen is for the app to perform the same actions a browser (like chrome, for instance) does when executing the javascript code in the Cloudflare page. Unfortunately, the Cloudflare code is obfuscated, which makes decoding it a tedious affair.

Lady-Awinita commented 2 years ago

Yeah, the site itself is throwing a HUGE cloudflare browser check when trying to read stories. {browsing and searching and viewing profiles, bowser check never happens, but click on a story and BAm browser check occurs}

This happens roughly every 3 hours, the reason the browser check is happening constantly is because the cookie that cloudflare sets is NOT locking like it should {by which it would know "OK I checked that browser its clear dont need to check it for a year} instead the cookie i getting looked at by cloudflare and cloudflare is going "HEY I DIDNT CHECK THAT!" like the memo didnt get written down or something

I truly wish sometimes I knew how to do things like coding to be of any help but all I can really do is point out bugs

canerolu2019 commented 2 years ago

Hi,

Thanks for the support. Unfortunately, I won't be able to look into the issue until mid-december due to work.

Truth to be told, there's not much to research per se, particularily if you've never programmed javascript before.

The only way to bypass the Cloudflare screen is for the app to perform the same actions a browser (like chrome, for instance) does when executing the javascript code in the Cloudflare page. Unfortunately, the Cloudflare code is obfuscated, which makes decoding it a tedious affair.

I left you some cloudflare bypassers in the reply section. Idk if you checked it. Hope it comes in handy for you

thinkpad4 commented 2 years ago

@genious7 Any closer on a fix to bypass cloudflare?

Baggytrousers27 commented 2 years ago

Bit of a roundabout method to suggest but hear me out:

There was another fic reading app a few years back called CodexReader and one of its methods for backing up stories was to save them as .epub files.

Ff.net currently does not allow you to select text to avoid copying stories but this can be bypassed by something as simple as entering reading mode on firefox. Would it be possible to save stories manually, convert them to a file type the app can use and carry on that way until some other method can be found around the cloudflare nonsense?

Certainly fiddly and a bit technical but it's better than just not using the app for the indefinite future.

ghrrrr commented 2 years ago

What would it take to redesign the app so that it could act as a browser or work on a browser in the background (chrome for example) and then convert that in to the format that we use? I started learning java just for this when the app last broke, and even took a few classes on the subject, planning to help you, but due to finding some work arounds coupled with the fact real life concerns taking priority made me stop halfway. Now same thing is happening again... I wish i could have continued. But if we could find a permenant solution to the crap they are pulling, i am sure enough of us would be willing to pay -at least i am- instead of using their torture instrument they are passing as an app... Even their bookmarking system is faulty... How crappy do you have to be to not "remember" the stories i read or which chapter i was on half the time....

canerolu2019 commented 2 years ago

Bit of a roundabout method to suggest but hear me out:

There was another fic reading app a few years back called CodexReader and one of its methods for backing up stories was to save them as .epub files.

Ff.net currently does not allow you to select text to avoid copying stories but this can be bypassed by something as simple as entering reading mode on firefox. Would it be possible to save stories manually, convert them to a file type the app can use and carry on that way until some other method can be found around the cloudflare nonsense?

Certainly fiddly and a bit technical but it's better than just not using the app for the indefinite future.

What kind of file type exactly? Also reading mode??

genious7 commented 2 years ago

What would it take to redesign the app so that it could act as a browser or work on a browser in the background (chrome for example) and then convert that in to the format that we use?

It already does that. The class CloudflareFragment.java simulates an android WebView; that's exactly how I bypassed it the first time it broke.

From what I can tell, the current Cloudflare screen was designed specifically to block this app, as it reloads the web page several times while loading in order to confuse the browser regarding when a page has finished loading and is ready to be displayed.

I've looked a bit into the issue, but I've found no straightforward solution to the problem. Honestly speaking (and given that the Cloudflare page was made specifically against this app and not as a general measure), I'm also a bit hesitant into engaging on a cat-and-mouse routine with the FF.net staff.

BShelf42 commented 2 years ago

In theory if cloud flare loads the page several times bfr it actually loads. Can you have you app wait like a minute before it reads the webpage for example to give cloud flare time Todo it's loading thing? I know that would make thing take long for us user but I don't mind Abit of patience if the app works.

You app is literally the only way I read fanfiction anymore and I don't understand why FF.net problem with it. They aren't providing a paid service you can steal, you aren't taking away web traffic. They might be upset about the lack of Ad revenue but I use ad blocker on the website anyway and I know others do to.

On Mon, Jan 17, 2022, 8:17 PM Michael Chen @.***> wrote:

What would it take to redesign the app so that it could act as a browser or work on a browser in the background (chrome for example) and then convert that in to the format that we use?

It already does that. The class CloudflareFragment.java https://github.com/genious7/FanFictionReader/blob/master/fanfictionReader/src/main/java/com/spicymango/fanfictionreader/menu/CloudflareFragment.java simulates an android WebView; that's exactly how I bypassed it the first time it broke.

From what I can tell, the current Cloudflare screen was designed specifically to block this app, as it reloads the web page several times while loading in order to confuse the browser regarding when a page has finished loading and is ready to be displayed.

I've looked a bit into the issue, but I've found no straightforward solution to the problem. Honestly speaking (and given that the Cloudflare page was made specifically against this app and not as a general measure), I'm also a bit hesitant into engaging on a cat-and-mouse routine with the FF.net staff.

— Reply to this email directly, view it on GitHub https://github.com/genious7/FanFictionReader/issues/84#issuecomment-1015011648, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV3G42WMXLCCQ6DFGP4YMGLUWTEUPANCNFSM5GXJ7D4Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

BShelf42 commented 2 years ago

I'm actually learning Java too just so I can attempt to keep the app going for my own use, though my knowledge is very much a work in progress still.

On Mon, Jan 17, 2022, 8:17 PM Michael Chen @.***> wrote:

What would it take to redesign the app so that it could act as a browser or work on a browser in the background (chrome for example) and then convert that in to the format that we use?

It already does that. The class CloudflareFragment.java https://github.com/genious7/FanFictionReader/blob/master/fanfictionReader/src/main/java/com/spicymango/fanfictionreader/menu/CloudflareFragment.java simulates an android WebView; that's exactly how I bypassed it the first time it broke.

From what I can tell, the current Cloudflare screen was designed specifically to block this app, as it reloads the web page several times while loading in order to confuse the browser regarding when a page has finished loading and is ready to be displayed.

I've looked a bit into the issue, but I've found no straightforward solution to the problem. Honestly speaking (and given that the Cloudflare page was made specifically against this app and not as a general measure), I'm also a bit hesitant into engaging on a cat-and-mouse routine with the FF.net staff.

— Reply to this email directly, view it on GitHub https://github.com/genious7/FanFictionReader/issues/84#issuecomment-1015011648, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV3G42WMXLCCQ6DFGP4YMGLUWTEUPANCNFSM5GXJ7D4Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

lightningHoneypot commented 2 years ago

Honestly speaking (and given that the Cloudflare page was made specifically against this app and not as a general measure), I'm also a bit hesitant into engaging on a cat-and-mouse routine with the FF.net staff.

Just only this app? I hope not, I think there are other apps that are affected too.

ghrrrr commented 2 years ago

What would it take to redesign the app so that it could act as a browser or work on a browser in the background (chrome for example) and then convert that in to the format that we use?

It already does that. The class CloudflareFragment.java simulates an android WebView; that's exactly how I bypassed it the first time it broke.

From what I can tell, the current Cloudflare screen was designed specifically to block this app, as it reloads the web page several times while loading in order to confuse the browser regarding when a page has finished loading and is ready to be displayed.

I've looked a bit into the issue, but I've found no straightforward solution to the problem. Honestly speaking (and given that the Cloudflare page was made specifically against this app and not as a general measure), I'm also a bit hesitant into engaging on a cat-and-mouse routine with the FF.net staff.

So if i understood correctly, cloudflare does fake loads that doesn't include actual page several times before actually loading it. And this app is taking the first fake load as an answer to the querry, hence the empty page. This being an open source app must make it easier for them to take targeted shots at it. So i understand your reluctance to engage in a match where the opponent knows all your moves but don't give up please. I almost stopped reading new stories because of this issue and keep going back to your app and re-read older stories.

I don't know if this makes sense but is it possible for app to wait until all information packages are received and fakes are discarded before reaching out for the actual text in the part that simulates the android WebView?

canerolu2019 commented 2 years ago

What would it take to redesign the app so that it could act as a browser or work on a browser in the background (chrome for example) and then convert that in to the format that we use?

It already does that. The class CloudflareFragment.java simulates an android WebView; that's exactly how I bypassed it the first time it broke.

From what I can tell, the current Cloudflare screen was designed specifically to block this app, as it reloads the web page several times while loading in order to confuse the browser regarding when a page has finished loading and is ready to be displayed.

I've looked a bit into the issue, but I've found no straightforward solution to the problem. Honestly speaking (and given that the Cloudflare page was made specifically against this app and not as a general measure), I'm also a bit hesitant into engaging on a cat-and-mouse routine with the FF.net staff.

You cant just give up quick dude. We all love you for creating this app for the UI you have created and has a lovely interface. I get it you are feeling a bit worried, playing cat and mouse game with the FF staff, even though you havent found a solution for this im sure you will find another one. Just pls dont give up dude. Im sure you can do this. We all believe in you. :)

BShelf42 commented 2 years ago

In theory can't you have the app wait like a minute for cloud flare to do its fake loading thing bfr reading the page? I know that would mean longer load times for us users but I don't mind Abit of patience. You can make any further updates to the app private or just push them to the beta channel without updating GitHub further.

I too am learning Java solely bc of this app I'll see if I can do something with it after work

Baggytrousers27 commented 2 years ago

Bit of a roundabout method to suggest but hear me out: There was another fic reading app a few years back called CodexReader and one of its methods for backing up stories was to save them as .epub files. Ff.net currently does not allow you to select text to avoid copying stories but this can be bypassed by something as simple as entering reading mode on firefox. Would it be possible to save stories manually, convert them to a file type the app can use and carry on that way until some other method can be found around the cloudflare nonsense? Certainly fiddly and a bit technical but it's better than just not using the app for the indefinite future.

What kind of file type exactly? Also reading mode??

On firefox (android app and desktop browser) if a page's contents is mostly text a little page symbol shows up in the address bar that toggles reader view (F9 shortcut on desktop) which allows for manipulation of text; Size, serif, spacing and selection etc. reading mode 1 reading mode 2 image . Essentially the whole highlight protection on ff.net is rendered moot by a feature built into firefox. Almost like their "plagiarism protections," aren't actually meant for stopping plagiarising. The fact that the site runners seem to be targeting this particular app speaks volumes about them. Don't get their ad money if people read through 3rd party.

Lady-Awinita commented 2 years ago

It isnt just this app beoing hit by the cloudflare issue, its the website as a whole, and its gotten worse

Baggytrousers27 commented 2 years ago

It isnt just this app beoing hit by the cloudflare issue, its the website as a whole, and its gotten worse

That it has.

lightningHoneypot commented 2 years ago

It isnt just this app beoing hit by the cloudflare issue, its the website as a whole, and its gotten worse

That it has.

How is that? For me, all I see when browsing Fanfiction is basically like how I found ff back in 2008 internet man... 2008, time really flies so quick now 😢

Lady-Awinita commented 2 years ago

It isnt just this app beoing hit by the cloudflare issue, its the website as a whole, and its gotten worse

That it has.

How is that? For me, all I see when browsing Fanfiction is basically like how I found ff back in 2008 internet man... 2008, time really flies so quick now 😢

Basically, browsing the site is all the same, its never changed, but when you click on a story to read it, you get hit with the cloudflare browser check

lightningHoneypot commented 2 years ago

It isnt just this app beoing hit by the cloudflare issue, its the website as a whole, and its gotten worse

That it has.

How is that? For me, all I see when browsing Fanfiction is basically like how I found ff back in 2008 internet man... 2008, time really flies so quick now 😢

Basically, browsing the site is all the same, its never changed, but when you click on a story to read it, you get hit with the cloudflare browser check

I see

canerolu2019 commented 2 years ago

I hope @genious7 doesnt give up on this app. This app is my number 1 source on reading fanfiction :)

Baggytrousers27 commented 2 years ago

It isnt just this app beoing hit by the cloudflare issue, its the website as a whole, and its gotten worse

That it has.

How is that? For me, all I see when browsing Fanfiction is basically like how I found ff back in 2008 internet man... 2008, time really flies so quick now 😢

What'll really bake your noodle is that there are stories on there from the 90s.

canerolu2019 commented 2 years ago

I hope some new update comes.

PlytonRexus commented 2 years ago

Though it might seem a bit counter-intuitive, what do you think about building a PWA with much the same features and UI as the app? That should more or less likely solve the captcha problem and allow most other features.

Also, could a proxy work, maybe? The app sends requests to a separate server, which makes requests to FF.net. I mean a proper custom proxy with a browser sending the requests, and not a VPN sort of thing,

Any idea how the official app works and fetches stories? Does it do something different from this one? I'll try decompiling it later this weekend. Maybe it'll lead to something. But if somebody knows, please tell me.

If this app is singled out, would it be possible to simply change the package name and upload a second copy of the app on PlayStore?

Beck-919 commented 2 years ago

I thought of suggesting a PWA as well, but it seems like they are limited by the amount of space the underlying browser can use on the phone.

Although possibly a PWA can connect to this app, 'forward' the cookies/'pass the cloudflare check' and refer back whenever that expires. Just a thought.

PlytonRexus commented 2 years ago

I thought of suggesting a PWA as well, but it seems like they are limited by the amount of space the underlying browser can use on the phone.

Mega does something about this problem while downloading.

PlytonRexus commented 2 years ago

A quick google brought me here. Haven't read it completely but looked helpful in this case. Please check once @Beck-919

More about limits here.

Luminatrix-eng commented 2 years ago

What would it take to redesign the app so that it could act as a browser or work on a browser in the background (chrome for example) and then convert that in to the format that we use?

It already does that. The class CloudflareFragment.java simulates an android WebView; that's exactly how I bypassed it the first time it broke.

From what I can tell, the current Cloudflare screen was designed specifically to block this app, as it reloads the web page several times while loading in order to confuse the browser regarding when a page has finished loading and is ready to be displayed.

I've looked a bit into the issue, but I've found no straightforward solution to the problem. Honestly speaking (and given that the Cloudflare page was made specifically against this app and not as a general measure), I'm also a bit hesitant into engaging on a cat-and-mouse routine with the FF.net staff.

@genious7 To be honest, I have a suspicion that the owner of the Fanfiction.net site sold his or her site to some third party and that third party has no passion for stories but is using this highly visited site to push ads revenue solely for money. And because considerable enormous chunk of readers use reader apps instead of visiting the site, potentially this owner was stingy about it and wanted more $$$ and so opted for cloudflare to block reader apps.

Not even the admins or moderators seem to know what is going on.

In any case, I hate the official reader app because it's not very good whereas your app is awesome but they are being so anal about third party readers that I'm starting to think Fanfiction.net website is a lost cause. I've been thinking of using AO3 site.

Thank you so much for your amazing efforts to get your fanfiction app working again. Your app is my go to for reading stories and for many years to come.

ghost commented 2 years ago

@genious7, when you are done fixing your app, can you redesign its interface to be something more modern like this example: 1 2 7

Lady-Awinita commented 2 years ago

When it comes to cloudflare, they screwed the pooch because they ended a cookie that SHOULD be locked into place. the admin and offical fictionpress twitter arent answering anyone since thanksgiving 2021, since then cloudflare has gotten worse, and there is currently no way to contact cloudflare for the broken cookie never getting set when it tries to set the cookie for 1 year

Luminatrix-eng commented 2 years ago

When it comes to cloudflare, they screwed the pooch because they ended a cookie that SHOULD be locked into place. the admin and offical fictionpress twitter arent answering anyone since thanksgiving 2021, since then cloudflare has gotten worse, and there is currently no way to contact cloudflare for the broken cookie never getting set when it tries to set the cookie for 1 year

Like I said, I'm currently of the opinion that the original fanfiction site owner sold his/her site to some third party who is only interested in money hence the absurd amount of endless ads plastered everywhere. All evidence points to it.

They used cloudflare to prevent third party reader apps from downloading stories to force people to load ads on their pages. They screwed the pooch with a lot of things, and don't really have a whole lot of hope that things are going to get better. It's why I started using AO3 site as my main go-to.

ghrrrr commented 2 years ago

When it comes to cloudflare, they screwed the pooch because they ended a cookie that SHOULD be locked into place. the admin and offical fictionpress twitter arent answering anyone since thanksgiving 2021, since then cloudflare has gotten worse, and there is currently no way to contact cloudflare for the broken cookie never getting set when it tries to set the cookie for 1 year

Like I said, I'm currently of the opinion that the original fanfiction site owner sold his/her site to some third party who is only interested in money hence the absurd amount of endless ads plastered everywhere. All evidence points to it.

They used cloudflare to prevent third party reader apps from downloading stories to force people to load ads on their pages. They screwed the pooch with a lot of things, and don't really have a whole lot of hope that things are going to get better. It's why I started using AO3 site as my main go-to.

The silly thing about that is, they have so far done nothing to prevent ad-block usage. So it looks like their main concern is not actually the ad revenue, but the fact that one guy years ago in his spare time created an app that suppresses theirs by so wide a margin that they have not been able to bridge the gap in years.

I don't know it is simply pride or they have other plans in the works but what they are doing is completely unethical. I would understand their reluctance to allow third party apps, IF they were servicing original contents that they themselves have created. But almost every fanfiction writer submits their works freely. A very small minority are holding chapters hostage on sites like patreon or something but that is against the site policy anyway.

To be honest they have neither a logical reason nor an ethical justification to prevent the usage of this app.

genious7 commented 2 years ago

@ghrrrr I agree, I don't really understand why they went out of their way to block all apps (mine is certainly not the only one affected, although I'm fairly certain that they targeted this one to an extent).

About the only thing that I guess could (somewhat) be their motivation would be to lessen the server load, as the update library button checks each story for updates one by one. The API that they mentioned in a twitter would have fixed that, but that appears to have died.

Regarding fixing the issue, I've decided to give up for the moment since I can't think any way around the issue.

Currently, the app uses a WebView to simulate a web browser. However, the android WebView always adds a x-requested-with header, which means that the FanFiction server can always tell the request is coming from an app. While the header can be changed, it cannot be disabled, which means that it is impossible to hide the fact that the request is coming from an app and not from a web browser while using the webview.

The only other alternative I can think of is using Mozilla's Gecko View instead of the default android Web View. While I'm fairly certain that Mozilla's browser alternative would load the page, I was unable to find any function to retrieve the HTML code from the browser after it had finished loading in order to pass it to the app.

slenderknight1 commented 2 years ago

@genious7 I was wondering if it can't be fixed for the FanFiction website would you be able to allow the app to use other websites like it? I'm just curious if this is possible? I really love this app and I have been using it for about 4 years and I don't really want it to get fubared.

BShelf42 commented 2 years ago

Okay so when I started hunting around for a function to read or pull html using GeckoView I found this stackoverflow question (with answers/solutions) that was similar. I am still learning but is this anything that can help you? https://stackoverflow.com/questions/57950119/how-can-i-render-html-with-using-geckoview

BShelf42 commented 2 years ago

Found This!!!!!!

So there isn't a GeckoView function that can be used directly with the app but you (or someone else) can make a GeckoView extension (like how Chrome has browser extensions) that can be imbedded in the app to read HTML and pass it along to the app. This Mozilla documentation explains in more detail

https://firefox-source-docs.mozilla.org/mobile/android/geckoview/consumer/web-extensions.html

slenderknight1 commented 2 years ago

Does anyone have an update?