-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: Improve fantia upload support #8
Comments
Icon in address bar appears on the post pages, not direct links. But I think it kinda makes sense to enable it for direct links too, because in Chrome it is always enabled - should unify behavior across browsers. Supporting extra pages looks doable too. I'll try to do something once I have free time. Also, missing context menu for videos is intentional. Every website implements players differently - it's pain in the ass to extract proper direct URLs (if even possible at all). It's unlikely I'll be adding it myself, but PRs are welcome. |
mp4 from fantia make up a large part of mp4 files on danbooru that are not sourced from twitter. Since the address you get redirected to after clicking "download" is already a direct video url that is played in browser using its default player, and that is just works when you manually paste it in the upload form, so what is effectively needs to be done is passing the correct |
Took a closer look. So far does not look as trivial as I though.
I have an idea how to do pt.1, solution should also work for stuff like https://i.redd.it/5zwrzdhjuco61.jpg where you get redirected to |
I don't really get this part. If I have a signed url (after clicking download), I can download the file from it anywhere - be it same browser, separate browser, curl, or by feeding it to danbooru upload form. There is no need for danbooru server to subscribe to the artist. The only annoying part of this workflow is having to manually fix the "bad link" - due to lack of The rest - I don't understand at all, as I'm not familiar with the webextension api. In any case, at first glance it looks like pt.2 and pt.3 are trivial to implement with a simple fantia-specific tampermonkey userscript. I'll work on it by myself. |
When you click a context menu option, extension receives values of Here's the code: upload-to-danbooru/src/refererGetter.js Lines 17 to 27 in c9bfddf
Example:
This is what extension receives. None of this data is useful, since we're not uploading samples to Danbooru. Exactly the same happens if you enable context menu for regular links, but with different In order to receive original image, you have to actually follow |
I ended up making the userscript for myself. |
There are at least three types of media that can be attached to fantia post.
Related: danbooru/danbooru#5580
For all three cases below, ideal behavior would be - both direct image
url
, and page addressref
(or url that can be converted into one by danbooru), are present1.
post_content_photo
- somewhat workingFor example, https://fantia.jp/posts/2302310
Each image has to be open individually.
On https://fantia.jp/posts/*/post_content_photo/* page:
/uploads/new
- danbooru can't extract the image;url
, as well as this page asref
, are sent to/uploads/new
- danbooru can extract both the image and page address (assuming PR above is merged)If I "Open Image in New Tab", on https://cc.fantia.jp/uploads/post_content_photo/file/* page:
url
andref
- danbooru can extract the image, but not the page address2.
album_image
- not workingFor example, https://fantia.jp/posts/2293136
Each image has to be open individually.
Clicking on the image opens https://fantia.jp/posts/*/album_image?query=* page, which redirects to https://cc.fantia.jp/uploads/album_image/file/*/* page. Here:
/uploads/new
asurl
- danbooru can't extract the image;3.
download
/post_content/file
- not workingFor example, https://fantia.jp/posts/61560
Similar to
album_image
, but context menu item does not appear on mp4 videoThe text was updated successfully, but these errors were encountered: