Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

4chan Scraper | Save Media From a 4chan Thread | Async, LINQ, Lambdas

Everyone here keeps bullying me because of the one liner/LINQ-y solutions I always post. Unlike my previous releases, I decided to practice what I preach this time and for your enjoyment, loaded it with lots of LINQ queries and lambdas to the point where it was more feasible not to involve them in some cases. So if for some reason you don't want an extension that does this in your browser, this is the tool for you-- assuming you don't opt for one of the cooler ones made with WPF, most of which work using Regex but where's the fun in that? Regex was used only to parse out the board and thread number, otherwise: OOP!

Feature list:
  • Retain original name or use server-issued ID

  • Download .webms which I'm not sure if other extensions support.

  • Also supports .pdf and .swf files

  • Automatically creates sub-folder for thread



This application has been targeted at framework 4.5 for the latest asynchronous methods. So you'll find the source littered with Async & Await markers and also to use the HttpClient class for, well... just because. My only issue is channeling errors back to the UI across methods. Suggestions for this would be appreciated.

Demonstration: (Click to View)

Downloads:
Full source (GitHub)
Binary only (Mediafire) - virus scan

Known issues:
-None so far. Hopefully it stays this way.

Credits:
4chan API documentation: https://github.com/4chan/4chan-API
Clover icon: www.iconarchive.com/show/st-patricks-day-icons-by-kristina-lim/st-patricks-day-clover-icon.html
PatPositron's deserializing guide just for me: hackforums.net/showthread.php?tid=4837734
this looks really good, thanks for sharing you the real mvp
Nice little tool, now I can download a whole trap thread in one! (Not really)

Nice tool though
[Image: hezQUJ3.png]
Not sure when I'll be able to use this, but meh... I'll save it just in case I find something nasty to download from 4chan.

Thx <3
Finally released it ayee? Nice share Lord Odus.

[Image: 1zL3pDG.jpg]

I made one of these a long time ago for scraping anime boards to create renders,
it's pretty useful.
Skype: happy.cbb
0x38E6A0912657E
Thanks everyone 😁 I'm still looking for feedback on the code though. Edit- 61 downloads and nothing???

(Jun 11, 2015 03:07 PM)SIM-1676753 Wrote:  Finally released it ayee? Nice share Lord Odus.

Yup, Turkish govt. has blocked 4chan which made working on this incredibly hard having to verify with captcha each page load.
Well written, just like your title, i need some function of your source code , thank you bro.
Posting to bookmark, thanks.
Looks like a cool tool for errr reasons :P
First of all. The source is not a one-liner.
Second. How many child porn pictures can I download per second?

Now in all seriousness: Seems like a nice cool project. You may not see it, but I am giving you a thumbs up.
Nice tool bro 🙂 thank you very much
Since you asked for it here are some things I found:

To start off, why are you making a contract with the devil by browsing one of hell's domains, namely '4chan'. I always thought you followed the 10 commandments of Google. You heretic! /sarcasm

Why do you mix const/readonly instance variables and const variables inside methods? Shouldn't it be more logical to have img_url (_img_url) and json_uri (_json_uri) under _regex instead of in a method?

In the DownloadFileAsync method, why have an empty Catch? You could for instance have it retry one more time before giving up. DownloadFile may give a one-time error. I vaguely remember something about an empty Catch being bad.

This is not really something bad, but I'd seperate each method with an empty line. Makes it a lot cleaner in my opinion.
[Image: IQE6i8G.png]

BlackCap Wrote:You're even more verbose than Java.
About using GoTo's in VB/C#:
Only3 Wrote:asm use it why u shouldnt
(Jun 13, 2015 06:44 AM)Ninja Wrote:  First of all. The source is not a one-liner.
Second. How many child porn pictures can I download per second?

Now in all seriousness: Seems like a nice cool project. You may not see it, but I am giving you a thumbs up.

Very sorry to disappoint, you can eliminate the line spacers and fill it with a bunch of colons, or convert to C# and do the same with brackets. The image rate depends on your connection and I see your thumbs up crystal clear.

(Jun 13, 2015 12:13 PM)Temploit Wrote:  To start off, why are you making a contract with the devil by browsing one of hell's domains, namely '4chan'. I always thought you followed the 10 commandments of Google. You heretic! /sarcasm

Microsoft actually pays me to use Bing.

(Jun 13, 2015 12:13 PM)Temploit Wrote:  Why do you mix const/readonly instance variables and const variables inside methods? Shouldn't it be more logical to have img_url (_img_url) and json_uri (_json_uri) under _regex instead of in a method?

My thought behind this was keep it relevant to the scope, but now that you mention it, you do have a point.

(Jun 13, 2015 12:13 PM)Temploit Wrote:  In the DownloadFileAsync method, why have an empty Catch? You could for instance have it retry one more time before giving up. DownloadFile may give a one-time error. I vaguely remember something about an empty Catch being bad.

Originally, I had thought of taking more care with the error handling, but a failed download would likely be down to either the thread 404ing or the file pruned.

(Jun 13, 2015 12:13 PM)Temploit Wrote:  This is not really something bad, but I'd seperate each method with an empty line. Makes it a lot cleaner in my opinion.

Am I the only one with reference counters enabled? You're the second person to say this now. Okay, you have my word I'll space out method bodies before releasing my next projects.

Thank you for the feedback though, I appreciate it.
(Jun 13, 2015 01:14 PM)Odus Wrote:  Am I the only one with reference counters enabled? You're the second person to say this now. Okay, you have my word I'll space out method bodies before releasing my next projects.

why didnt u listen to the first1 😧


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by ahmet1257Mar 10, 2022 09:51 AM 2 227 Mar 10, 2022 09:51 AM
Last Post: benio2
[C#] by LookdadonMar 7, 2022 01:38 PM 7 261 Mar 7, 2022 01:38 PM
Last Post: Lookdadon
[C#] by Jake JohnsonDec 10, 2020 09:25 AM 3 304 Dec 10, 2020 09:25 AM
Last Post: Xamarin