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

Some Twitter accounts return [twitter][info] No results for #2354

Open
konomikitten opened this issue Mar 2, 2022 · 22 comments
Open

Some Twitter accounts return [twitter][info] No results for #2354

konomikitten opened this issue Mar 2, 2022 · 22 comments

Comments

@konomikitten
Copy link

Seems to happen if I reference a single tweet or the whole account not sure if there are other accounts affected this is just the first one I found.

Failing account:

$ gallery-dl https://twitter.com/mightbecursed/status/1492954264909479936
[twitter][info] No results for https://twitter.com/mightbecursed/status/1492954264909479936

Working account:

$ gallery-dl https://twitter.com/oicolatcho/status/1010783805668331520
./gallery-dl/twitter/oicolatcho/1010783805668331520_1.jpg

Version:

$ gallery-dl --version
1.20.5
@Hrxn
Copy link
Contributor

Hrxn commented Mar 2, 2022

With the latest dev version from master:

PS D:\Temp> gallery-dl -v
Debug  :  gallery-dl -> Version 1.20.6-dev
Debug  :  gallery-dl -> Python 3.10.2 - Windows-10-10.0.19043-SP0
Debug  :  gallery-dl -> requests 2.27.1 - urllib3 1.26.8
usage: gallery-dl [OPTION]... URL...
gallery-dl: error: The following arguments are required: URL
Use 'gallery-dl --help' to get a list of all options.
PS D:\Temp>

Your second example:

PS D:\Temp> gallery-dl https://twitter.com/oicolatcho/status/1010783805668331520
Info   :  twitter -> Logging in as @<redacted>
* E:\Down\Twitter\Tweets\Pictures\oicolatcho__2018-06-24__DgcGgsfUEAATz4R__1010783805668331520_1.jpg
PS D:\Temp>

First example:

PS D:\Temp> gallery-dl https://twitter.com/mightbecursed/status/1492954264909479936 --verbose
Debug  :  gallery-dl -> Version 1.20.6-dev
Debug  :  gallery-dl -> Python 3.10.2 - Windows-10-10.0.19043-SP0
Debug  :  gallery-dl -> requests 2.27.1 - urllib3 1.26.8
Debug  :  gallery-dl -> Starting DownloadJob for 'https://twitter.com/mightbecursed/status/1492954264909479936'
Debug  :  twitter -> Using TwitterTweetExtractor for 'https://twitter.com/mightbecursed/status/1492954264909479936'
Debug  :  urllib3.connectionpool -> Starting new HTTPS connection (1): twitter.com:443
Debug  :  urllib3.connectionpool -> https://twitter.com:443 "GET /i/api/graphql/aD0-HB47XIOxiBl5kTkX5Q/TweetDetail?variables=%7B%22focalTweetId%22%3A%221492954264909479936%22%2C%22with_rux_injections%22%3Afalse%2C%22withCommunity%22%3Atrue%2C%22withQuickPromoteEligibilityTweetFields%22%3Atrue%2C%22withBirdwatchNotes%22%3Afalse%2C%22includePromotedContent%22%3Afalse%2C%22withSuperFollowsUserFields%22%3Atrue%2C%22withBirdwatchPivots%22%3Afalse%2C%22withDownvotePerspective%22%3Afalse%2C%22withReactionsMetadata%22%3Afalse%2C%22withReactionsPerspective%22%3Afalse%2C%22withSuperFollowsTweetFields%22%3Atrue%2C%22withClientEventToken%22%3Afalse%2C%22withVoice%22%3Atrue%2C%22withV2Timeline%22%3Afalse%2C%22__fs_interactive_text%22%3Afalse%2C%22__fs_dont_mention_me_view_api_enabled%22%3Afalse%7D HTTP/1.1" 200 5184
Debug  :  twitter -> Using download archive 'E:\Transfer\Meta\gallery-dl\archives\gldl-archive-twitter.db'
Debug  :  twitter -> Active postprocessor modules: [ClassifyPP]
Debug  :  urllib3.connectionpool -> Starting new HTTPS connection (1): pbs.twimg.com:443
Debug  :  urllib3.connectionpool -> https://pbs.twimg.com:443 "GET /media/FLgJ_bvUYAA_otr?format=jpg&name=orig HTTP/1.1" 200 237275
* E:\Down\Twitter\Tweets\Pictures\mightbecursed__2022-02-13__FLgJ_bvUYAA_otr__1492954264909479936_1.jpg
Debug  :  twitter -> Skipping 1492955807624974342 (reply)
Debug  :  twitter -> Skipping 1492956365987405824 (reply)
Debug  :  twitter -> Skipping 1492966606938382336 (reply)
Debug  :  twitter -> Skipping 1492989238081691655 (reply)
Debug  :  twitter -> Skipping 1493004646692044803 (reply)
Debug  :  twitter -> Skipping 1493017194971553792 (reply)
Debug  :  twitter -> Skipping 1493257244447854600 (reply)
PS D:\Temp>

Works fine as well..

Authentication with an account is suggested here. When I open https://twitter.com/mightbecursed/status/1492954264909479936 in an incognito tab I'll get this warning:

Age-restricted adult content. This content might not be appropriate for people under 18 years old. To view this media, you’ll need to log in to Twitter.

@konomikitten
Copy link
Author

Age-restricted adult content. This content might not be appropriate for people under 18 years old. To view this media, you’ll need to log in to Twitter.

Silly me I should've tried opening the specific account in a private tab first, still is there anyway gallery-dl can give a little more info other than "No results for" it really doesn't give the user much to go on?

@GiovanH
Copy link
Contributor

GiovanH commented Mar 4, 2022

Fxtwitter is still able to anonymously download these images. https://github.com/robinuniverse/TwitFix

This can be fixed in gallery-dl too

@thatfuckingbird
Copy link
Contributor

The syndication API doesn't have the login gate, for now:
https://cdn.syndication.twimg.com/tweet?id=<tweet id>
https://syndication.twitter.com/timeline/profile?suppress_response_codes=true&screen_name=<user name>&with_replies=false&with_retweets=false

Could be used as fallback maybe?

@cold-quix
Copy link

I ran into this problem today, and I'm pretty sure I found out the cause of the problem after a little tinkering.

It seems Twitter recently prohibited accounts without their birth dates from viewing explicit content (whether the user or Twitter marks content as explicit is beyond me). This also appears to extend to Nitter instances since Nitter just pulls the data from Twitter's servers, so although you can view hundreds of images on Nitter with no account at all, if you try to download them with gallery-dl then it doesn't work.

Thus, if you wanted to use gallery-dl to download explicit content you would need to:

  • Have a Twitter account
  • Attach a date of birth (Twitter warns you not to use a fake one, but who cares?) that indicates your age is sufficiently old
  • Log in to Twitter via a web browser and get an auth_token cookie
  • Configure gallery-dl's config file to authenticate your account with username, password, and an auth_token cookie

My config file info for Twitter looks like this:

"username": "<username>",
	"password": "<password>",
	"cookies": {
		"auth_token": "<cookie value>"
	}

And now I'm downloading the images that I wasn't able to just an hour ago.

@thatfuckingbird
Copy link
Contributor

Downloading from nitter doesn't work because gallery-dl doesn't try to download from nitter, it just looks at the nitter URL and tries to download the same content from twitter. Nitter itself can get around the account requirement for now and so can show you the images (see my previous post).

Sadly for people who refuse to give their phone number to twitter and make an account, there is no workaround yet for gallery-dl.

@konomikitten
Copy link
Author

Sadly for people who refuse to give their phone number to twitter and make an account, there is no workaround yet for gallery-dl.

It's sad that there's no workaround but for me this is more a matter of informing the user the reason no results are found is because the account is age restricted rather than a confusing generalised message such as "No results for". Opening up the account in a private tab where I am not logged in shows:

Screenshot_2022-03-08_05-39-15

Clicking "yes, view profile" then shows the following:

Screenshot_2022-03-08_05-39-37

What I am asking is that gallery-dl should inform the user that the profile and subsequently the tweets are age restricted and therefore cannot be downloaded, rather than just giving a generalised error message which is what caused me to create this issue in the first place. If I'd seen something like "This account is age restricted unable to continue" etc I'd have not thought gallery-dl had a bug that I needed to report.

@tux93
Copy link
Contributor

tux93 commented Mar 7, 2022

I thought at first the new age gate was to blame as well, but I can see the Tweets that return No results for in gallery-dl with my account on the web just fine, and I use auth via cookies.txt in gallery-dl

@GiovanH
Copy link
Contributor

GiovanH commented Mar 8, 2022

Sadly for people who refuse to give their phone number to twitter and make an account, there is no workaround yet for gallery-dl.

Yes. This is a defect. That's what this thread is for.

@Hrxn
Copy link
Contributor

Hrxn commented Mar 8, 2022

I don't think there's a workaround here...
Unless someone knows some "secret", internal API, authentication with your own account is the only way to access restricted content.

@Hrxn
Copy link
Contributor

Hrxn commented Mar 8, 2022

Fxtwitter is still able to anonymously download these images. https://github.com/robinuniverse/TwitFix

This can be fixed in gallery-dl too

I don't think so.

Glancing over the description of this project, you can basically think of it as a middleman. So, based on their example (https://fxtwitter.com/[twitter video url]), you can access a direct link to a media file hosted by Twitter, but it still requires authentication, it's just their authentication credentials that get used here. So, all limits to API access etc. still apply.

@Hrxn
Copy link
Contributor

Hrxn commented Mar 8, 2022

  • Have a Twitter account
  • Attach a date of birth (Twitter warns you not to use a fake one, but who cares?) that indicates your age is sufficiently old
  • Log in to Twitter via a web browser and get an auth_token cookie
  • Configure gallery-dl's config file to authenticate your account with username, password, and an auth_token cookie

My config file info for Twitter looks like this:

"username": "<username>",
	"password": "<password>",
	"cookies": {
		"auth_token": "<cookie value>"
	}

And now I'm downloading the images that I wasn't able to just an hour ago.

Correct with regard to account requirements and account settings used on Twitter, but if I'm not mistaken - and the Twitter extractor does something unusual here - this config example does not work as implied. When supplying both account credentials (as username and password) and an authentication cookie, gallery-dl will simply pick one of them, but it can't make use of them both at the same time...

@tux93
Copy link
Contributor

tux93 commented Mar 8, 2022

I thought at first the new age gate was to blame as well, but I can see the Tweets that return No results for in gallery-dl with my account on the web just fine, and I use auth via cookies.txt in gallery-dl

So today I ran into an interesting phenomenon: on some of the Tweets that returned this message in gallery-dl the download works after a few retries, which strengthens my suspicion that the age gate is not the only factor here.

@mikf
Copy link
Owner

mikf commented Mar 8, 2022

There is now a warning when gallery-dl can't access age-restricted tweets.(64bbc79)

I'll try to make use of the syndication endpoints from #2354 (comment) to lookup any age-restricted tweets, since that seems to be the only way that still works. (where did you find these?)

The official API (used by TwitFix #2354 (comment)), just returns an error for age-restricted Tweets:

{
    "errors": [
        {
            "code": 34,
            "message": "Sorry, that page does not exist."
        }
    ]
}

Nitter itself can get around the account requirement for now and so can show you the images (see my previous post).

Nitter doesn't do anything special in this regard (I looked at its source code) and several instances show "No items found". Instances located in France, India, or potentially other countries where Twitter hasn't applied these restrictions yet still work (https://nitter.42l.fr/mightbecursed), but the main instance located in Germany does not (https://nitter.net/mightbecursed), so maybe using a French VPN or proxy might work.

And if nothing else helps, there is always the option of buying a burner phone and registering a new account with that.

When supplying both account credentials (as username and password) and an authentication cookie, gallery-dl will simply pick one of them, but it can't make use of them both at the same time...

Yep, it will only use the auth-token cookie in that case and ignore username and password.

@thatfuckingbird
Copy link
Contributor

I'll try to make use of the syndication endpoints from #2354 (comment) to lookup any age-restricted tweets, since that seems to be the only way that still works. (where did you find these?)

Hydrus uses these for a long time now (out of necessity, since it's not advanced enough to use the graphql-based main API) and some users reported that it gets around the block.

Nitter doesn't do anything special in this regard (I looked at its source code) and several instances show "No items found".

I just tried some other countries that my VPN provider has servers in, but it's all blocked: Belgium, Germany, Netherlands, Romania, Switzerland, US, Canada, New Zealand, Ukraine, Japan, Brazil. They don't have servers in either France or India so couldn't check those, but I'm not sure it's location based (or if it is, it's only a few countries).

And if nothing else helps, there is always the option of buying a burner phone and registering a new account with that.

Sadly you can't buy burner phones anymore in many EU countries, since all mobile providers require ID to use the network by law.

@jadedgnome
Copy link

I'll try to make use of the syndication endpoints from #2354 (comment) to lookup any age-restricted tweets, since that seems to be the only way that still works. (where did you find these?)

were you able to make any progress on this?

if not, would it be possible for you to support niitter.42l.fr urls instead?

@kattjevfel
Copy link
Contributor

@jadedgnome That is being tracked at #2415

mikf added a commit that referenced this issue Apr 7, 2022
to fetch age-restricted content using Twitter's  syndication API
@mikf
Copy link
Owner

mikf commented Apr 7, 2022

There is now support for grabbing "age-restricted" tweets via syndication API without login (1171911).

At the moment this feature is disabled by default, mostly because sometimes the API returns a 404 error for several minutes until it gives an actual result, and it also has to query each Tweet separately.

This is most likely going to enabled by default in the next release, but for now it needs the syndication option enabled to have an effect.

@kattjevfel
Copy link
Contributor

If it has such drawbacks, surely this won't be used when signed in, right?

@thatfuckingbird
Copy link
Contributor

If it has such drawbacks, surely this won't be used when signed in, right?

If you are signed in, those tweets will be visible to gallery-dl so it won't even consider using the fallback.

@jadedgnome
Copy link

jadedgnome commented Apr 8, 2022

There is now support for grabbing "age-restricted" tweets via syndication API without login (1171911).

At the moment this feature is disabled by default, mostly because sometimes the API returns a 404 error for several minutes until it gives an actual result, and it also has to query each Tweet separately.

This is most likely going to enabled by default in the next release, but for now it needs the syndication option enabled to have an effect.

thanks a lot!

edit: there seems to be some .m3u8 files saved as well as .mp4 files.

mikf added a commit that referenced this issue Apr 21, 2022
- ignore .m3u8 manifests
- always select largest format
@github-userx
Copy link

By the way, you can get a Twitter account without phone number by reaching out to their support after your account gets locked.

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

10 participants