-
-
Notifications
You must be signed in to change notification settings - Fork 995
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
Can't set retweets to download to a separate folder #1481
Comments
I "fixed" this by downloading to a directory further in with retweets enabled, with a script that follows the downloaded images out if they match the target username. |
I thought it might've been possible to do this with Sorry to bug you, @mikf, but you got any ideas? |
I suspect it's more cuz f-strings are executed in runtime (can't be stored, then executed later) while Plus it's faster and way more powerful than the old printf-style percentage format still used by youtube-dl for compatibility, something that couldn't do something like |
f-strings are Python 3.6+ only and I kind of want to keep Python 3.4 compatibility for gallery-dl v1.x. |
Care to explain how on earth that works and how you managed to come up with it? I am very confused This feels like it should be documented somewhere |
So if
I know, and it kind of is here. |
I think this cannot possibly work, by the way.
The good news: This should be possible now. Look here: https://github.com/mikf/gallery-dl/blob/master/docs/configuration.rst#extractordirectory The "directory": {
"retweet_id != 0" : ["Twitter", "{user[name]}", "Retweets"],
"" : ["Twitter", "{user[name]}"]
} @ExeArco Could you please try this? |
config.set(
("extractor", "twitter"),
"directory", [
{
"retweet_id != 0" : ["{category}", folder,"archive", "retweets"],
"" : ["{category}", folder,"archive"]
}
]
) This is what I attempted to use, however it gives me the following error: And just to confirm, I am on 1.18.0. |
It was implemented one commit after 1.18.0 |
Alright I updated to 1.18.1-dev and I get this error instead |
Your config.set(
("extractor", "twitter"),
"directory", {
"retweet_id != 0" : ["{category}", folder, "archive", "retweets"],
"" : ["{category}", folder, "archive"],
},
) |
Alright well I fixed that but now it doesn't seem to be separating them at all, it seems that it doesn't ever trigger the retweet != 0 condition. config.set(("extractor", "twitter"), "filename", "{user[name]}_{tweet_id}_{date}_{num}.{extension}")
config.set(("extractor", "twitter"), "quoted", True)
config.set(("extractor", "twitter"), "text-tweets", True)
config.set(("extractor", "twitter"), "retweets", "original")
config.set(
("extractor","twitter"),
'postprocessors', [
{
"name": "metadata",
"event": "post",
"filename": "{user[name]}_{tweet_id}_{date}_{num}.data.json"
}
]
)
config.set(
("extractor", "twitter"),
"directory", {
"retweet_id != 0" : ["{category}", folder,"archive", "retweets"],
"" : ["{category}", folder,"archive"]
},
) |
It is not really possible to differentiate between Tweets and Retweets when setting |
I'm using this to archive the user profile themselves, not passing through individual retweet/tweet/status links, so I can't check each URL itself. |
What's the specific reason for not using |
If I set retweets = true it sets the username of the retweet to the target of my download, not the original poster of what is being retweeted. |
You can use |
Yes, that is exactly what I am using here. |
If I do as Scripter17 has suggested it works however it now doesn't sort out quoted retweets., and looking through the metadata json that I have, it appears there is not anything I can use to sort that out, unless I am missing anything. |
Do you mean regular quote tweets or quotes of a retweet?
Quoted tweets have a non-zero "directory": {
"retweet_id": ["{category}", folder, "archive", "retweets"],
"quote_id" : ["{category}", folder, "archive", "quotes"],
"" : ["{category}", folder, "archive"],
} I've also updated the behavior of |
I'll be honest I'm not sure exactly what this is called either, but take this example. |
I am still looking for a fix to this, does anyone have one? |
Not sure, but if this is what gets returned by Twitter.. PS D:\> gallery-dl --ignore-config -K 'https://twitter.com/BarackObama/status/1408818108224131074' --option '"quoted"=true' | sls "tweet|quote|reply" -NoEmphasis -Context 0,1
> quote_count
439
> quote_id
0
> reply_count
268
> reply_id
0
> retweet_count
792
> retweet_id
0
> tweet
> tweet_id
1408510014847959053
> quote_count
439
> quote_id
0
> reply_count
268
> reply_id
0
> retweet_count
792
> retweet_id
0
> tweet
> tweet_id
1408510014847959053
PS D:\> This tweet seems a bit strange.. If I don't use So, something is a bit off here, I guess. I blame Twitter. |
I mean it is a quoted tweet right? |
As it turns out, Instead of checking for "directory": {
"retweet_id" : ["{category}", folder, "archive", "retweets"],
"user != author": ["{category}", folder, "archive", "quotes"],
"" : ["{category}", folder, "archive"],
} |
Only present for tweets quoted by another tweet. Represents the tweet_id of said tweet quoting this one.
use "locals().get('quote_by')" |
According to the following issues on github this feature should be available.
##1421
##1334
I am currently on version 1.17.2.
I have tried a variety of things to set for "retweets" but nothing changes unless I set it to False.
Then it doesn't download retweets, as should be expected.
When I feed gallery-dl a url that is a users twitter page I want to download the users tweets in a base folder then their retweets in a separate folder within their folder.
For Example:
targetUser
targetUser/retweets
That is what I want.
The text was updated successfully, but these errors were encountered: