SthephanShinkufag / Dollchan-Extension-Tools

The best way to browse imageboards
https://dollchan.net/extension/
MIT License
368 stars 67 forks source link

[kohlchan.net]: Support discussion #1332

Closed sunabozu closed 1 month ago

sunabozu commented 5 years ago

Is your feature request related to a problem? After the recent switch to https://gitgud.io/Tjark/KohlNumbra Kohlchan doesn't support Dollchan anymore.

Describe the solution you'd like to see in the implementation Can somebody look into it and tell if it's possible to add the support?

SthephanShinkufag commented 5 years ago

Compare the parameters of requests. They are the same.

StephenLynx commented 5 years ago

Ah yeah, I misread it lmao.

StephenLynx commented 5 years ago

I dunno, I don't know how to use dollchan to test it out. But you should double check what you are sending. Either the md5 and mime of the file is not matching, or the length of one of the meta data is shorther. Try putting the new file before the existing files when you post and see if something changes.

StephenLynx commented 5 years ago

And btw, kc uses the extension to figure out mime instead of what the browser reports. So take that in consideration. If you look at their FE, you will see this method is changed there too.

zedmike commented 5 years ago

There is a bug with post dates.

  1. Open any thread in tab/browser A.
  2. Write some post.
  3. Open the same thread in a different tab/browser B. -> Times should be correct.
  4. In tab/browser B write a post.
  5. Refresh A -> Time is incorrect.

And while at it: Deleting posts does not work.

I always get a post date that is two hours behind the older post's dates. Only new posts have the two hour behind issue, no matter how the "Time correction in posts*" setting and parser filter is changed.

ritz127 commented 5 years ago

@ritz127 I don't understand what do you mean. I can't see any timestamp link. Show me a screenshot.

It is disabled by default, so you need to enable it in Settings > Other > UNIX timestamp filenames if you want to test it by yourself. Then enter a thread and wait until someone posts a picture, or just do it yourself in a different tab. It creates a link in this format: https://kohlkanal.net/.media/ce06487aa14e416ff0eae7096a070ca1-imagejpeg.jpg/1564801999367.jpg but the last part is not added to posts loaded after the original page load.

Most likely this is happening because posting.updateAllUnixFilenames() is not being called ( line 74 here https://gitgud.io/Tjark/KohlNumbra/blob/master/static/js/posting.js ) The same goes for posting.updateAllLocalTimes() which is probably causing the bug with post dates using UTC if loaded by dollchan's auto-update feature but local time otherwise.

Here's a screenshot where you can see both bugs - the two posts were made one hour apart, not four

SthephanShinkufag commented 5 years ago

Built-in native thread updater was not blocked by Dollchan because of CSP content security policy. Also youtube embedder did not show youtube thumbnails due to CSP. nocsp.kohlchan.net does not have a blocking.

ganego commented 4 years ago

Add ibDomains['kohlkanal.net'] = Kohlchan;

kr4ssi commented 4 years ago

Add ibDomains['kohlkanal.net'] = Kohlchan;

Shouldn't that usually work if I just put it under the line with kohlchan.net? Why doesn't it?

ganego commented 4 years ago

Add ibDomains['kohlkanal.net'] = Kohlchan;

Shouldn't that usually work if I just put it under the line with kohlchan.net? Why doesn't it?

It does.

kr4ssi commented 4 years ago

Under certain circumstances dollchan tries to create a new thread instead of replying to the existing one when quick-replying from the board index, I think only if before any thread got polled, but I'm not sure.

kr4ssi commented 4 years ago

There also is no quick-reply-button for posts invoked by an url-anchor.

HuongChanoi commented 4 years ago

Hello Team,

all posts that are submitted via the postmenu (reply-to function) are not working since the recent captcha update for kc a few days ago. Also the post date offset function doesn't seem to work either.

Kindly check up on the issue.

kr4ssi commented 4 years ago

Drawing doesn't work with dollchan activated

ganego commented 4 years ago

@SthephanShinkufag There are two really annoying bugs with KC left in DC. One of them stopping some people from using DC at all on KC.

1) When using a proxy (or Tor), KC will give you a captcha to solve every two days (or until you delete the captcha cookie). This captcha cannot be solved with DC enabled because the popup won't show.
2) Deleting posts does not work, gives some error.


Info: 1) Can be tested by accessing KC via Tor. Either the normal URL or the onion URL (see kohlchan.net/links.html). Be aware that when using Tor, you will first have to wait for/solve the "Kohlcash" test. It's simply a script that brute forces some hash (nothing to do with bitcoin or so despite the name) in order to stop people from spamming. You only have to do this once (if you don't delete this cookie). This has nothing to do with the captcha problem and works fine. Just telling you so you won't be surprised.
You can write test posts to some thread in /m/ (trash board).

2) Error:

Internal error:
TypeError: form.action.split is not a function
    at sendHTML5Post (Dollchan%20Extension%20Tools.user.js#1:15964:29)
    at html5Submit (Dollchan%20Extension%20Tools.user.js#1:9365:14)
    at addStuff/delBtn.onclick (Dollchan%20Extension%20Tools.user.js#1:14909:6)

Thank you

ganego commented 4 years ago

Deleting posts does not work, gives some error.

Fix: https://github.com/SthephanShinkufag/Dollchan-Extension-Tools/blob/082abae0ecd8ccbd678df7c52f804115110723fd/src/Dollchan_Extension_Tools.es6.user.js#L15961

const task = form.action.split('/').pop(); -> const task = form.attributes.action.value.split('/').pop();

Writing posts still works.

Npaffen commented 3 years ago

The "post menu" at KC is the button with the exclamation mark. It ordinarily shows a menu to report a post as "inappropriate" for example. I would really appreciate if this feature could be implemented.

Blue Button on the right side : http://prntscr.com/vfycpr Post menu : http://prntscr.com/vfydps

pdftk commented 3 years ago

If i try to post on Kohlchan with pictures or videos attached, i get an error message.

Internal error: TypeError: dc.body is undefined at getSubmitError (Dollchan%20Extension%20Tools.user.js?id=a0e200e5-601d-4d5c-b6f3-446ef4cd7035:9096:5) at checkUpload (Dollchan%20Extension%20Tools.user.js?id=a0e200e5-601d-4d5c-b6f3-446ef4cd7035:9114:13)

Posting just text works fine.

ganego commented 3 years ago

If i try to post on Kohlchan

.net or .onion? Extension or script? Version?

...

Install this: https://github.com/SthephanShinkufag/Dollchan-Extension-Tools/raw/master/src/Dollchan_Extension_Tools.es6.user.js

pdftk commented 3 years ago

I am using it on https://nocsp.kohlchan.net I am using the Userscript (20.3.17.0) with Tampermonkey(4.11.6120) in Firefox(83.0).

gruzefix commented 3 years ago

@ganego ganego mentioned this issue 5 days ago [Bug] Can't post pictures anymore on kohlchan.net #1389

I did what was asked, namely

Search for function checkUpload After const isDocument = data instanceof HTMLDocument; add: alert(isDocument); Before error = getSubmitError(_data); add a new line with: alert(1); Before error = getSubmitError(data); add a new line with: alert(2);

The first popup returns false and the following 1.

I also used Violentmonkey instead of Tampermonkey as you suggested.

ganego commented 3 years ago

Ok the false should be correct and we now know where the error occurs exactly.

Go into this function again and search for data = JSON.parse(_data); then add a new line above that with console.log(_data);. Now open the devtools in FF (right-click somewhere on the page -> Inspect Element). Then click on "Console". Then write a post. There should be a new line. If everything was correct it should look like this: {"status":"ok","data":12345}. The number is the post number.
Please tell what it says for a post without a picture that works and one where it does not work when you attach a picture. When your post does not show up at all, at this point it should be the server rejecting your post and this reply will tell the reason (hopefully).

Unfortunately as I said, I have no issues at all, so it's hard to investigate.

gruzefix commented 3 years ago

Text only: {"status":"ok","data":4587950}

With an image it doesn't return anything, but the popup in the upper right corner gives out the following: TypeError: dc.body is undefined at getSubmitError (%20Dollchan%20Extension%20Tools.user.js#1:9105:5) at checkUpload (%20Dollchan%20Extension%20Tools.user.js#1:9124:13) at promise callback*_initAjaxPosting/this.form.onsubmit (%20Dollchan%20Extension%20Tools.user.js#1:8855:44)

ganego commented 3 years ago

Strange. Are you sure you put the line above the JSON? Does there at least show up an empty line? We are going to test that.

Remove the line you put there and now add the following below const _data = (isDocument ? data.body.textContent : data).trim();:

console.log(isDocument); console.log(data); console.log("---- data end"); console.log(_data); console.log("---- _data end");

Post the result, with the maybe empty lines. Theoretically output should be false and data & _data should be identical.

Do you have JavaScript enabled for KC? Not that it should matter but who knows.

We cannot just remove the error handling, because it happens after the post was sent. So it's the server rejecting the post for whatever reason, otherwise it should have shown up at least at this point.

ganego commented 3 years ago

Updated version with several fixes for KC, support for KC onion URLs (including fixed image-search), support for m4v and ogg/opus files. You can now also click on the search button for an image/video and the name of it will be added as a quote.

https://github.com/ganego/Dollchan-Extension-Tools/blob/master/src/Dollchan_Extension_Tools.es6.user.js

SthephanShinkufag commented 3 years ago

When using a proxy (or Tor), KC will give you a captcha to solve every two days (or until you delete the captcha cookie). This captcha cannot be solved with DC enabled because the popup won't show.

Done. Dollchan asks for captcha now.

ganego commented 3 years ago

Another thing, when you preload images and then click on the file name, Firefox will download them with the blob's name/id instead of the correct file name. I fixed this in my build and now put it on github, see the last three commits (I made them in the correct files for you instead of the big script file): https://github.com/ganego/Dollchan-Extension-Tools/commits/master

This will add an additional button in front of the file name, that will download the preloaded blob with the correct name.

SthephanShinkufag commented 3 years ago

@ganego Good idea, I will check tomorrow. Probably, it was necessary to create a new Issue, because this is not related to kohlchan. Or even a pull request, because this is your implementation proposal. Also, for convenience and consistency you can compile modules into big script, and vice versa:

  1. Install Git and Node.js if not yet.
  2. Install Gulp using Git: npm rm -g gulp npm install -g gulp-cli
  3. Using Git, go to Dollchan repo and update dependencies: cd Dollchan-Extension-Tools npm install
  4. Then you can make both ES5 and ESNext userscript versions from module files (/src/modules) by running: gulp make
  5. Or you can make ESNext version only: gulp make:es6
  6. Also you can make separate source modules from your ESNext version: gulp make:modules
SthephanShinkufag commented 3 years ago

@ganego https://github.com/SthephanShinkufag/Dollchan-Extension-Tools/commit/5809518748de1b58fb84c3e21dcaec191dd8c25e

Image_links_02 Image_links_01

Now the searching button gives download links with names :

  1. With original name
  2. For webm - with the name obtained from the metadata (when enabled "Images" > "Load titles from WebM metadata")
  3. With the number given by the board.

Metadata loaded from webm is now highlighted in yellow.

ganego commented 3 years ago

This is always enabled yes (did not test yet)?

My use-case for the patch above is/was the following:

"Name from Metadata" is a nice idea.

SthephanShinkufag commented 3 years ago

No additional buttons!!!

SthephanShinkufag commented 3 years ago

Thread with preload enabled: Problem: Click on image name downloads image with blob id; bad.

Lol wut. This is kohlchan-only bug maybe.

Preload_names

SthephanShinkufag commented 3 years ago

Thread with preload enabled: Problem: Click on image name downloads image with blob id; bad.

This is not a blob. This is a kohlchan bug. Due to unusual lynxchan qualities.

Kohlchan_imagename_bug_01 Kohlchan_imagename_bug_02

ganego commented 3 years ago

This is not a blob.

You did not preload the images...

image

This is how a preloaded image looks like.

SthephanShinkufag commented 3 years ago

@ganego

Yes, I show you the screenshot before the preload, to look how the original href looks like, and where the download attribute takes its incorrect value. Download attribute allows you to download file with custom name. Download attribute on your screenshot has the value that Dollchan incorrectly takes from the href attrbiute before preload. This is not a blob name! Compare the href value and download value!

SthephanShinkufag commented 3 years ago

Done. As I said, Dollchan took the wrong source. .imgLink (image container link) have just /.media/e8560b2a85ba98f802b5eed20d3e61c998c56c3ff07198a8bb957c8379aed85c.png. Now the href will be taken from .originalNameLink that have /.media/e8560b2a85ba98f802b5eed20d3e61c998c56c3ff07198a8bb957c8379aed85c.png/dl/Zeitplan.png

ganego commented 3 years ago

Noice. Seems to work.

kr4ssi commented 3 years ago

Kohlchan does a hash-check before uploading a file, so the upload will get skipped if the file is up already. This doesn't work with dollchan enabled, the file will get uploaded every time.

To reproduce: -Upload a big file (dollchan may be enabled) -Disable Dollchan -Upload the same file again -Upload gets skipped (And still posted) -Enable Dollchan -File gets uploaded again (And posted)

kr4ssi commented 3 years ago

When pointing on a link to an answered post on the board-index, the "Nr."-Link in this preview points to the index-page, like https://www.kohlchan.net/b/#4840205 (except for when this post is still visible on the index-page) grafik grafik

kr4ssi commented 3 years ago

Sometimes, when quick-replying from the board-index, a new thread is created instead of replying. I'm not sure how to reproduce yet, maybe related to the bug above.

kr4ssi commented 3 years ago

Tools for painting aren't visible in quick-reply

SthephanShinkufag commented 3 years ago

@ganego

There is a bug with post dates. 1) Open any thread in tab/browser A. 2) Write some post. 3) Open the same thread in a different tab/browser B. -> Times should be correct. 4) In tab/browser B write a post.
5) Refresh A -> Time is incorrect.

@zedmike

I always get a post date that is two hours behind the older post's dates. Only new posts have the two hour behind issue, no matter how the "Time correction in posts*" setting and parser filter is changed.

@ritz127

kohlchan has a code in https://kohlchan.net/.static/js/posting.js which adds unix timestamp download links for each file, currently it's not working with dollchan. initial load adds all links correctly but this is ignore by dollchan's auto-updater.

It is disabled by default, so you need to enable it in Settings > Other > UNIX timestamp filenames if you want to test it by yourself. Then enter a thread and wait until someone posts a picture, or just do it yourself in a different tab. It creates a link in this format: https://kohlkanal.net/.media/ce06487aa14e416ff0eae7096a070ca1-imagejpeg.jpg/1564801999367.jpg but the last part is not added to posts loaded after the original page load. Most likely this is happening because posting.updateAllUnixFilenames() is not being called ( line 74 here https://gitgud.io/Tjark/KohlNumbra/blob/master/static/js/posting.js ) The same goes for posting.updateAllLocalTimes() which is probably causing the bug with post dates using UTC if loaded by dollchan's auto-update feature but local time otherwise. Here's a screenshot where you can see both bugs - the two posts were made one hour apart, not four

Fixed. Many thanks to @konacha !

konacha commented 3 years ago

@SthephanShinkufag Something in this update broke the reverse search menu. It no longer shows on hovering. Not sure if it's related to the unix timestamp fix, because it still worked as of my last commit.

Edit: This section maybe? Reverse search links should still use the original filename, not the unix timestamp.

SthephanShinkufag commented 3 years ago

@konacha That was trying to add an ability to download with unixtime names through menu.

konacha commented 3 years ago

Due to recent refactoring some stuff stopped working (again ;_;) I had to block thumbs.js in my browser, otherwise Dollchan can't expand videos properly. Posting gets stuck on "checking" forever. Posts are still submitted, but files are ignored.

SthephanShinkufag commented 3 years ago

@konacha Issues are now observed even with 2019 script versions. I did not check it further. Also, in tampermonkey the problem is observed almost every time, and in greasemonkey it is more rarely.

SthephanShinkufag commented 3 years ago

Probably the kohlchan admins changed something, and now it conflicts with Dollchan.

konacha commented 3 years ago

Probably the kohlchan admins changed something, and now it conflicts with Dollchan.

That's what I meant, the refactor was on kohlchan's side https://gitgud.io/Tjark/KohlNumbra/-/commits/master

It happened only once before, when they added websockets and it broke Dollchan's autoupdate. But that was quickly fixed. I haven't found any bugs other than posting (randomly works and stops working) and video thumbs. If I find anything else I'll report it here

SthephanShinkufag commented 3 years ago

@konacha Oh, I thought "Due to recent refactoring" was addressed to me. Also will be absent from the mountain trip for the next couple of weeks, I will be glad if you find anything during this time. Thank you!

zedmike commented 3 years ago

Can't upload stuff on /int/