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

Feature Request: Using Post Title as Filename #18

Closed
Pineapple1989 opened this issue Oct 1, 2023 · 3 comments
Closed

Feature Request: Using Post Title as Filename #18

Pineapple1989 opened this issue Oct 1, 2023 · 3 comments

Comments

@Pineapple1989
Copy link

Is it possible to use the post title or the post content as the files name that is downloaded? It just makes it a bit easier to search. I tried doing it myself but had no success.

@darkdragn
Copy link
Owner

darkdragn commented Nov 3, 2023

Yeah, I can look into it. The complication here is that we compile a list of files from all posts without preserving the origination post details. I could add that as a supplemental field, or run the download from the top level to get around this. When I threw this together, I did things the way they are to make it easier to add a progress bar. It's honestly not a big change to make. In all honesty, the CLI is the only thing that would receive the overhaul. The backend user and post libraries are already prepped to do just this.
Would you prefer {PostTitle} - {FileName}.{FileExtension} or just {PostTitle} - {FileIndex}.{FileExtension} ? I would need the index to make sure posts with multiple files get everything... Hhhmmm, a bigger undertaking would be adding metadata to image posts that could preserve everything. All post details, dates and all of the API metadata, but that's a pipe dream for a later date.

@darkdragn
Copy link
Owner

darkdragn commented Nov 3, 2023

Just finished adding it! Check it out:

darkdragn@penguin:~/src/party$ party kemono patreon Creux --post-title --limit 5
2023-11-03 01:33:28.110 | DEBUG    | party.cli:pull_user:114 - Excluded Extensions: []
⠹ User found: creux; parsing posts...Duplicate files found, recommend using post_id
Embedded objects found; saving to creux/.embedded
Downloading from user: creux
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 11/11 [00:23<00:00,  2.10s/it]
2023-11-03 01:34:16.140 | INFO     | party.cli:pull_user:199 - Output status: Counter({<StatusEnum.SUCCESS: 1>: 11})                                                                      
darkdragn@penguin:~/src/party$ ls creux/                                                                                                                                                  
'Bex & Keit - Medium Support_Bex_MediumSupport_1_Twitter.jpg'         'Lois Lane - Strip game - Part 2_LoisLane_StripGame02_1_Twitter.jpg'                                                
'Bex & Keit - Medium Support_Bex_MediumSupport_2_Patreon.jpg'         'Lois Lane - Strip game - Part 2_LoisLane_StripGame02_2_Twitter.jpg'
'Bex - Yellow Jacket_Bex_YellowJacket_1_Twitter.jpg'                  'Lois Lane - Strip game - Part 2_LoisLane_StripGame02_3_Patreon.jpg'
'Bex - Yellow Jacket_Bex_YellowJacket_2_Patreon.jpg'                  'Lucia - Concept Sheet_Splatball_Lucia_1_Twitter.jpg'
'Lois Lane - Strip game - Part 1_LoisLane_StripGame01_1_Twitter.jpg'  'Lucia - Concept Sheet_Splatball_Lucia_2_Patreon.jpg'
'Lois Lane - Strip game - Part 1_LoisLane_StripGame01_2_Patreon.jpg'

If you want to mix, I added robust formatting options. You can do things like: "{ref.post_id}_{ref.post_title}_{ref.index:03}.{ref.extension}" to get something like:

darkdragn@penguin:~/src/party$ party kemono patreon Creux --limit 5 --file-format "{ref.post_id}_{ref.post_title}_{ref.index:03}.{ref.extension}"
2023-11-03 01:36:43.384 | DEBUG    | party.cli:pull_user:114 - Excluded Extensions: []
⠧ User found: creux; parsing posts...Duplicate files found, recommend using post_id
Embedded objects found; saving to creux/.embedded
Downloading from user: creux
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:14<00:00,  1.09it/s]
2023-11-03 01:37:23.913 | INFO     | party.cli:pull_user:199 - Output status: Counter({<StatusEnum.SUCCESS: 1>: 16})                                                                      
darkdragn@penguin:~/src/party$ ls creux/                                                                                                                                                  
'86307825_Bex - Yellow Jacket_000.jpg'              '86462263_Lois Lane - Strip game - Part 2_003.jpg'             'Bex - Yellow Jacket_Bex_YellowJacket_1_Twitter.jpg'                   
'86307825_Bex - Yellow Jacket_001.jpg'              '88614838_Bex & Keit - Medium Support_000.jpg'                 'Bex - Yellow Jacket_Bex_YellowJacket_2_Patreon.jpg'                   
'86307825_Bex - Yellow Jacket_002.jpg'              '88614838_Bex & Keit - Medium Support_001.jpg'                 'Lois Lane - Strip game - Part 1_LoisLane_StripGame01_1_Twitter.jpg'
'86410843_Lois Lane - Strip game - Part 1_000.jpg'  '88614838_Bex & Keit - Medium Support_002.jpg'                 'Lois Lane - Strip game - Part 1_LoisLane_StripGame01_2_Patreon.jpg'
'86410843_Lois Lane - Strip game - Part 1_001.jpg'  '88831815_Lucia - Concept Sheet_000.jpg'                       'Lois Lane - Strip game - Part 2_LoisLane_StripGame02_1_Twitter.jpg'
'86410843_Lois Lane - Strip game - Part 1_002.jpg'  '88831815_Lucia - Concept Sheet_001.jpg'                       'Lois Lane - Strip game - Part 2_LoisLane_StripGame02_2_Twitter.jpg'
'86462263_Lois Lane - Strip game - Part 2_000.jpg'  '88831815_Lucia - Concept Sheet_002.jpg'                       'Lois Lane - Strip game - Part 2_LoisLane_StripGame02_3_Patreon.jpg'
'86462263_Lois Lane - Strip game - Part 2_001.jpg'  'Bex & Keit - Medium Support_Bex_MediumSupport_1_Twitter.jpg'  'Lucia - Concept Sheet_Splatball_Lucia_1_Twitter.jpg'
'86462263_Lois Lane - Strip game - Part 2_002.jpg'  'Bex & Keit - Medium Support_Bex_MediumSupport_2_Patreon.jpg'  'Lucia - Concept Sheet_Splatball_Lucia_2_Patreon.jpg'

@darkdragn
Copy link
Owner

@Pineapple1989 if you get a chance, let me know what you think about the updates. Also, check out #24 to see if you like that change too!

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

No branches or pull requests

2 participants