Skip to content
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

The [id] field has changed on Sankaku...is there a way to fix it? #6808

Open
Deejay85 opened this issue Jan 11, 2025 · 13 comments
Open

The [id] field has changed on Sankaku...is there a way to fix it? #6808

Deejay85 opened this issue Jan 11, 2025 · 13 comments

Comments

@Deejay85
Copy link

When downloading from Sankaku the format is usually something like e - 4353452.jpg, but it has recently changed to something entirely different like e - vsGrzlfsc.jpg. Is there a way to change this so I don't have to redownload EVERYTHING just to have the current changes to take effect? Because it's the ID field that's changed, I'm not sure, but I thought I'd ask to see if anyone had any leads I could follow.

@FoxieP
Copy link

FoxieP commented Jan 12, 2025

Yeah, 'ID' field changed... even old posts seems to have different id now.

@mikf
Copy link
Owner

mikf commented Jan 12, 2025

Related issue: #5073

I tried changing a bunch of header values for API requests, but nothing restored the old numeric IDs. Using them in URLs now even results in an error instead of a redirect:

$ gallery-dl https://chan.sankakucomplex.com/en/posts/360451
[sankaku][error] invalid id

@mikf
Copy link
Owner

mikf commented Jan 12, 2025

It is possible to use a post's md5 value as "ID", so we can most likely write a script that uses this to translate old numeric to new alphanumeric IDs:

$ gallery-dl https://chan.sankakucomplex.com/en/posts/ac8e3b92ea328ce9cf7211e69c905bf9
./sankaku/sankaku_y0abGlDOr2o_ac8e3b92ea328ce9cf7211e69c905bf9.jpg

@Deejay85
Copy link
Author

Deejay85 commented Jan 12, 2025

Is it possible for someone to write a script to update the files to the current [id]? I hope so because I'm staring down the barrel of a 16TB download if not...and that's not including using handbrake to convert all the bigger videos to 720p to save on hard drive space. 😑🔫

Then again...there is a metadata value I remember existing somewhere in the flags for gallery-dl...is there a way to just dump everything into one giant folder, and then look stuff up by their meta value? That would make redownloading everything worthwhile. 👍

@mo-han
Copy link
Contributor

mo-han commented Jan 12, 2025

Is it possible for someone to write a script to update the files to the current [id]? I hope so because I'm staring down the barrel of a 16_TB_ download if not...and that's not including using handbrake to convert all the bigger videos to 720p to save on hard drive space. 😑🔫

i do have:

  • TB of sankaku download ( but less than yours
  • re-encode video to save disk space

and i also have several python lib and script to do:

  • semi-auto update
  • auto renaming
  • auto-skip downloaded files by checking md5 in the name of files in target folder

but the python code mentioned above are not so easy to use:

  • they are coupled to some other code i'm using
  • you cannot simple download a copy of them and then just run them as-is
  • you need to read the code and do some tweak
  • they may not apply to your filename format or your work flow

Then again...there is a metadata value I remember existing somewhere in the flags for gallery-dl...is there a way to just dump everything into one giant folder, and then look stuff up by their meta value? That would make redownloading everything worthwhile. 👍

this sounds like some kind of

  • a tag based filesystem
  • a self-hosted local booru system

maybe you are interesting at https://github.com/hydrusnetwork/hydrus

@mo-han
Copy link
Contributor

mo-han commented Jan 12, 2025

@mikf

wow, never try that md5 string in URL.
it's like the hidden platform of nine and tree-quarters in the magic world.

if /posts/<md5> won't be dropped by sankaku in the future, maybe i will consider to drop the id section in the filename.
oh no, maybe too aggressive.

@mikf
Copy link
Owner

mikf commented Jan 12, 2025

it's like the hidden platform of nine and tree-quarters in the magic world.

I know of this feature only because someone opened an issue requesting support for it: #3952

@Deejay85
Copy link
Author

maybe you are interesting at https://github.com/hydrusnetwork/hydrus

I'm giving it a try right now. Unfortunately, the manual, and the lack of a video tutorial are making things take longer than they should. I still have to figure out how to manually download/auto tag stuff. :(

@mo-han
Copy link
Contributor

mo-han commented Jan 14, 2025

yeah, me as well, prefer downloading and manually sorting.

@Fghgks
Copy link

Fghgks commented Jan 14, 2025

Is it possible for someone to write a script to update the files to the current [id]?...

Isn't it such a good opportunity to start writing your own?
It's just

  1. to rename all files to "(md5).(extension)" (to rename with os tool)
  2. to make the list of them and add beginning of url to get the list of url with tag search by md5
  3. gallery-dl --rename "{md5}.{extension}" --no-download -i "urls.txt"

Then again...there is a metadata value...is there a way to just dump everything into one giant folder, and then...

If I understand you right, you can get metadata instead of actual files with
gallery-dl --write-metadata --no-download "url(s)"
It will create ~8kb text files with (all) metadata for each file.
The problem is urls. If you can make urls based on md5, then you do not need metadata at all.
Left options are downloading all site... or limit downloading with tags e.g. date or artists...

@ForxBase
Copy link

Anyone know how I can now download my thousands of links with the old numeric format? They don't open in the browser and gallery-dl doesn't download them anymore.

@Fghgks
Copy link

Fghgks commented Jan 14, 2025

Anyone know how I can now download my thousands of links with the old numeric format?

Only URL? No way unless sankaku developers do something.
Maybe if many people attack sankaku forum, they temporary will give a way to replace old id in links/files to new, but I doubt it.

@Phenrei
Copy link

Phenrei commented Jan 21, 2025

Anyone know how I can now download my thousands of links with the old numeric format? They don't open in the browser and gallery-dl doesn't download them anymore.

You'd have to extract the md5 from the file and search with that if you only used the numeric id in the filename.

Dropping my current filename string array here, using "created_at" value to keep them in post order in the folders (which was the main point of the old numeric ids anyway) plus appending their post id for uniqueness. Then md5 (for search in case I recomp any pngs or the like) plus a few useful tag values appended to the end. First artist and characters with limits if both present, then artist only, then "studio" tag used sometimes (with character if present), then character, then general copyright as a last backup. Helps me for later searching/sorting. For my existing rips I'm going to have to sim re-rip all my tags/posts into text files and then work on a program to rename by matching md5, thanks stupid sankaku changes.

"filename": {
	"'tags_artist' in locals() and 'tags_character' in locals()" : 
		"booru-{category}-{created_at}_{id}-{md5}-{tags_artist[0:5]!S:R, /__/}+{tags_character[0:8]!S:R, /__/}.{extension}",
	"'tags_artist' in locals()" :
		"booru-{category}-{created_at}_{id}-{md5}-{tags_artist[0:5]!S:R, /__/}.{extension}",
	"'tags_studio' in locals() and 'tags_character' in locals()" :
		"booru-{category}-{created_at}_{id}-{md5}-{tags_studio[0:5]!S:R, /__/}+{tags_character[0:8]!S:R, /__/}.{extension}",
	"'tags_studio' in locals()" :
		"booru-{category}-{created_at}_{id}-{md5}-{tags_studio[0:5]!S:R, /__/}.{extension}",
	"'tags_character' in locals()" :
		"booru-{category}-{created_at}_{id}-{md5}-{tags_character[0:8]!S:R, /__/}.{extension}",
	"'tags_copyright' in locals()" :
		"booru-{category}-{created_at}_{id}-{md5}-{tags_copyright[0:5]!S:R, /__/}.{extension}",
	"" :
		"booru-{category}-{created_at}_{id}-{md5}.{extension}"
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants