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

Any way to download twitter media or likes into one separate folder within the artist folder? #1421

Closed
ZenythFactor opened this issue Apr 1, 2021 · 20 comments

Comments

@ZenythFactor
Copy link

As I downloaded all the likes of said artist's twitter, i begun to notice they're downloaded in the same twitter directory folder instead of just the artist's folder and in a separate folder for likes, not generally.
Is there a possible way of doing that? Because I'd hate to go back to using Twitter Media Downloader to do separate downloads again ugh.

@Fukitsu
Copy link

Fukitsu commented Apr 1, 2021

You can do something like
"twitter": { "likes": { "directory": ["Twitter", "{user[name]}", "Likes"] } }

@ZenythFactor
Copy link
Author

You can do something like
"twitter": { "likes": { "directory": ["Twitter", "{user[name]}", "Likes"] } }

Neat
Do i put this as a command or a configuration file?

@Fukitsu
Copy link

Fukitsu commented Apr 1, 2021

In the config file

@ZenythFactor
Copy link
Author

In the config file

Thanks, i'll test this out and come back.

mikf added a commit that referenced this issue Apr 2, 2021
i.e. the 'screen_name' of the user whose liked tweets get extracted.

Ideally this would replace 'user' or at least be in the same format,
but that would break backwards compatibility or be impossible/too
complicated thanks to API result differences.

(#1421)
@mikf
Copy link
Owner

mikf commented Apr 2, 2021

#1421 (comment) is how it should work, but {user[name]} refers to the Tweet owner and not the user whose likes are being downloaded.

fd858ee adds a user_likes field which at least contains the screen_name of the right user, so this would be
"twitter": { "likes": { "directory": ["Twitter", "{user_likes}", "Likes"] } }

@ZenythFactor
Copy link
Author

#1421 (comment) is how it should work, but {user[name]} refers to the Tweet owner and not the user whose likes are being downloaded.

fd858ee adds a user_likes field which at least contains the screen_name of the right user, so this would be
"twitter": { "likes": { "directory": ["Twitter", "{user_likes}", "Likes"] } }

I see then.
It's getting a bit complicated for me, so I apologize.
Where exactly I should put the string at in the .conf file?

@Fukitsu
Copy link

Fukitsu commented Apr 4, 2021

You put it in the configuration file just like that. For example:
{ "extractor"" { "twitter": { "likes": { "directory": ["Twitter", "{user_likes}", "Likes"] } } } }

@ZenythFactor
Copy link
Author

You put it in the configuration file just like that. For example:
{ "extractor"" { "twitter": { "likes": { "directory": ["Twitter", "{user_likes}", "Likes"] } } } }

So just paste it in there at the bottom or top?
I apologize again. Very novice when it comes to stuff like this.

@mikf
Copy link
Owner

mikf commented Apr 6, 2021

Given the default config file, go to the twitter block and paste "likes": { "directory": ["Twitter", "{user_likes}", "Likes"] } in there:

        "twitter":
        {
            "likes": {
                "directory": ["Twitter", "{user_likes}", "Likes"]
            },
            
            "username": null,
            "password": null,
            "cards": false,
            "conversations": false,
            "quoted": true,
            "replies": true,
            "retweets": true,
            "twitpic": false,
            "users": "timeline",
            "videos": true
        },

@ZenythFactor
Copy link
Author

Given the default config file, go to the twitter block and paste "likes": { "directory": ["Twitter", "{user_likes}", "Likes"] } in there:

        "twitter":
        {
            "likes": {
                "directory": ["Twitter", "{user_likes}", "Likes"]
            },
            
            "username": null,
            "password": null,
            "cards": false,
            "conversations": false,
            "quoted": true,
            "replies": true,
            "retweets": true,
            "twitpic": false,
            "users": "timeline",
            "videos": true
        },

Alright, I did exactly what you shown and, as i feated, the likes are still not going to their respective singular folder.
Like, I desire to have all the downloaded like content into one single folder. Basically folder that is filled with all of the other folders filled with liked content.

image

Something like this, but the director is basically: "gallery-ld/twitter/[artist] likes". Basically just have the twitter folder not be mixed up with other profile folders that were just for the account's likes.

@mikf
Copy link
Owner

mikf commented Apr 7, 2021

then use "directory": ["twitter", "{user_likes} likes"] or something alike

@nisehime
Copy link

@mikf maybe it would be better if you add the third array, similar to user[] and author[], which contains metadata about the user, specified in the url. In case of direct tweet url it should be the author of this tweet, currently if you have conversations: true, you're also unable to save media from replies to a tweet to this tweet author's folder.

@Hrxn
Copy link
Contributor

Hrxn commented Jun 27, 2021

I think this issue can be closed, btw.

@ZenythFactor
Copy link
Author

I think this issue can be closed, btw.

Not yet
I admittedly forgotten to try any of the suggestions here.

If nothing resolves, i'll close it.

@Hrxn
Copy link
Contributor

Hrxn commented Jun 27, 2021

Should definitely be doable with conditional directory settings like here

@mikf
Copy link
Owner

mikf commented Dec 3, 2022

With 749802c and related commits, user is now always the user an input URL points to, which should resolve the problem here.

@mikf mikf closed this as completed Dec 3, 2022
@Kalidibus
Copy link

With 749802c and related commits, user is now always the user an input URL points to, which should resolve the problem here.

Is there any way to trigger the old behavior? I updated recently and this new behavior broke some important scripts for me. I likes having likes sorted into the different folders of the user that posted them as it allowed me to tag the artist to the files.

@mikf
Copy link
Owner

mikf commented May 20, 2023

@Kalidibus then use author instead of user.

user is the user referenced in the input URL
author is the user who created the Tweet

@Kalidibus
Copy link

Kalidibus commented Jun 21, 2023

@mikf - sorry I'm not having any luck still. I've tried the following:

"likes": { "directory": ["Twitter", "{author}", "Likes"] },
Results in OS errors because the folder name becomes extremely long

"likes": { "directory": ["Twitter", "{author-likes}", "Likes"] },
Everything goes into a folder called "None"

"likes": { "directory": ["Twitter", "{author-name}", "Likes"] },
Everything goes into a folder called "None"

@Hrxn
Copy link
Contributor

Hrxn commented Jun 21, 2023

@mikf - sorry I'm not having any luck still. I've tried the following:

"likes": { "directory": ["Twitter", "{author}", "Likes"] }, Results in OS errors because the folder name becomes extremely long

You can limit the length of field like this {author[:180]} (length in characters) or {author[b:180]} (length in bytes).
Please note, this is just an example, it's probably not the {author} field, but you can check this for yourself with gallery-dl -K <your_URL>

"likes": { "directory": ["Twitter", "{author-likes}", "Likes"] }, Everything goes into a folder called "None"

Please check if this value actually exists, you can do this with gallery-dl -K <your_URL>

"likes": { "directory": ["Twitter", "{author-name}", "Likes"] }, Everything goes into a folder called "None"

Same thing. gallery-dl -K <your_URL>

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

6 participants