bstats / b-stats

4chan archive (and imageboard) made for low-cost, low-performance servers
https://archive.b-stats.org/
GNU General Public License v3.0
11 stars 1 forks source link

API bugs #13

Closed ccd0 closed 7 years ago

ccd0 commented 7 years ago

First, the "remote_media_link" and "medialink" fields are populated with links to images that don't appear to work; for example, https://archive.b-stats.org//api/chan/post/?board=qst&num=1016664 links to https://images.b-stats.org/445cca0d94432ab9216e875286311634.png

This causes 4chan X, when building a post fetched from the b-stats archive, to have the file link point to the non-existent b-stats file. If the field were not there, 4chan X would link to 4chan, and if the link were dead, redirect to another archive if it existed. That said, if it's more convenient, this could be worked around on 4chan X's end; since we know from https://github.com/MayhemYDG/archives.json that b-stats isn't serving files, 4chan X could be set to ignore those entries.

Second, although this isn't affecting 4chan X at the moment, the "preview_orig" field under "media" doesn't seem to be implemented (4chan X only uses it if "thumb_link" is not there). Normally it would contain the filename of the thumbnail on 4chan, e.g. "1483758005699s.jpg"

FoolFuuka API docs: http://foolfuuka.readthedocs.io/en/latest/code_guide/documentation/api.html https://4plebs.tech/foolfuuka/

bstats commented 7 years ago

The full-image server is currently not accessible from the public internet, so that is why the links don't work. I think 4chanX should respect the archives.json and not try to link to images unless the board is included in the files array there.

As far as FoolFuuka API, I haven't found any good documentation on what each field means; I had to guess for most of them. Like, what is the difference between comment, comment_processed, and comment_sanitized ? I have no idea and the docs don't make any attempt to explain that. Anyway, I can add the preview_orig field for the sake of completion...

ccd0 commented 7 years ago

I think 4chanX should respect the archives.json and not try to link to images unless the board is included in the files array there.

Can do. Issue for this: https://github.com/ccd0/4chan-x/issues/1255

Like, what is the difference between comment, comment_processed, and comment_sanitized ? I have no idea and the docs don't make any attempt to explain that.

It looks like comment_processed converts to HTML on the server side: https://archive.4plebs.org/_/api/chan/post/?board=s4s&num=5063875

And comment_sanitized filters out invalid UTF-8: https://github.com/FoolCode/FoolFuuka/blob/93a8c238dc12c4b87e5d6c22a555173d46aac44d/src/Model/Comment.php#L203

4chan X uses only comment.

The docs could definitely use some improvement. I opened https://github.com/FoolCode/FoolFuuka-docs/issues/1 although I'm not sure if that repo is likely to ever be updated.