Issung / GChan

Scrape boards & threads from 4chan. Download images, videos and HTML if desired.
GNU General Public License v3.0
65 stars 10 forks source link

Doesn't download files anymore? Getting (403) forbidden in logs from 4chan #45

Closed Keklul404 closed 4 months ago

Keklul404 commented 4 months ago

Since some days ago, Ychan and a fork of Ychan (2.7.0) aren't capable of downloading files (no thumbs, pictures, video etc...) only the HTML is getting scraped from 4chan. Because of this I searched an alternative and found GChan today, yet, the same issue seems to happen here (I imagine a change from 4chan servers?)

At least, GChan does have a log system, so I can get a bit of information out of it, and no matter the boards, I get this error:

2024-06-18 15:13:54.8733 [Error] An error occured downloading an image. I:\Git\GChan\GChan\Trackers\ImageLink.cs:86 System.Net.WebException: Le serveur distant a retourné une erreur : (403) Interdit.
   à System.Net.WebClient.DownloadFile(Uri address, String fileName)
   à GChan.ImageLink.Download(SuccessCallback successCallback, FailureCallback failureCallback, CancellationToken cancellationToken) dans I:\Git\GChan\GChan\Trackers\ImageLink.cs:ligne 86
Status: ProtocolError
Response: System.Net.HttpWebResponse

The remote server returned an error: (403) Forbidden.

I am the only one to have this issue? Browsed 4chan on 2 different browsers (both with and without incognito mode) and didn't get any issues.

Using [v5.3.0] version.

Issung commented 4 months ago

Thank you for the report. There have been a couple of instances of this talked about in the discord too. It appears 4chan has altered their cloudflare protection rules to be a bit more sensitive. Though all people with the issue have reported being able to browse 4chan normally in their browsers.

Personally I haven't had the issue which makes it a bit hard to develop and test for. When I get some time I'll take a look at adding some error reporting in the GUI and maybe altering the user-agent header to see if that appeases cloudflare.

arimahoward commented 4 months ago

It is wired that even a static proxy can not get passed by this problem. Indeed, I can browse 4chan normally, but not able to download anything. @Keklul404 There is this thing that I have tested that currently works https://github.com/Staninna/4Chan-Media-Downloader It may suffice for the time being. @Issung Thank you for your consistent and precious update. There is only one wish from your amazing software, if a scroll bar can be added to the right when the amount of links exceeds certain amounts would be a tremendous help.

Issung commented 4 months ago

Hi @arimahoward thank you for the kind words. A scrollbar should appear when you have many threads. Could you make a separate issue with a screenshot example and I'll be happy to help when I can :)

Keklul404 commented 4 months ago

Thank you @Issung, and yes, effectively, I have no issue browsing, posting, making threads and downloading files on 4chan with the browser.

I tested various other app and found out that YChanEx doesn't have this problem right now, so I will use it for the time being until a possible fix is found here.

There is this thing that I have tested that currently works

Thanks, I'm using YchanEx for now until a fix is found.

Issung commented 4 months ago

Made a new release, https://github.com/Issung/GChan/releases/tag/v5.4.0. It uses a new User-Agent header, and allows you to customise it so you can do some further testing, for example copying the User-Agent header your browser uses. Let me know how it goes.

Keklul404 commented 4 months ago

Going to test it, thank you!

EDIT: Works perfectly ! Problem fixed !

Issung commented 4 months ago

Glad to hear it @Keklul404! Please consider a contribution if you are able, I maintain this program in my spare time 😁

https://ko-fi.com/issung https://github.com/sponsors/Issung?frequency=one-time