How to download Twitter videos

19 Replies, 736 Views

(06 Aug 2025, 23:04 )Like Ra Wrote:
(06 Aug 2025, 22:43 )dhf7b8g Wrote: it does also support standard user:pass combo login for twitter
It does not work for X anymore:

X Wrote:[twitter][error] AuthenticationError: Login rejected as suspicious

Very strange it works fine for me
 image.png   
(06 Aug 2025, 23:17 )dhf7b8g Wrote: Very strange it works fine for me
Strange indeed - just tried again with the same result 😕 Specifying --user-agent does not help.
(This post was last modified: 06 Aug 2025, 23:26 by Like Ra.)
(06 Aug 2025, 23:25 )Like Ra Wrote: Strange indeed - just tried again with the same result 😕 Specifying --user-agent does not help.

Only two things I can think of is a version difference (the gallery-dl verison my package manager installed is 1.29.7 which is not latest) or your account has been soft flagged as suspicious by twitter and they are being much stricter with how you are allowed to log on.
(06 Aug 2025, 23:39 )dhf7b8g Wrote: my package manager installed is 1.29.7
1.30.2 here. Installed via snap (Ubuntu).
(06 Aug 2025, 22:43 )dhf7b8g Wrote: On most standard operating systems and browsers it can auto grab the cookies i
Yep, but on Ubuntu one snap package can not access another without explicit permissions. Just tried by linking the snap firefox profile to the standard ~/.mozilla/firefox and with "--cookies-from-browser firefox" :

"[twitter][warning] cookies: [Errno 13] Permission denied: '...../cookies.sqlite'

Apparently, I have to export cookies into a file in the gallery-dl snap dir. So, it IS complicated 😂
(This post was last modified: 06 Aug 2025, 23:58 by Like Ra.)
(06 Aug 2025, 23:57 )Like Ra Wrote: Yep, but on Ubuntu one snap package can not access another without explicit permissions. Just tried by linking the snap firefox profile to the standard ~/.mozilla/firefox and with "--cookies-from-browser firefox" :

"[twitter][warning] cookies: [Errno 13] Permission denied: '...../cookies.sqlite'

Apparently, I have to export cookies into a file in the gallery-dl snap dir. So, it IS complicated 😂

Yet another avoidable linux issue caused by snap... canonical why are you so insistent on these packages?
(07 Aug 2025, 00:17 )dhf7b8g Wrote: Yet another avoidable linux issue caused by snap... canonical why are you so insistent on these packages?
I think. it's Mozilla's decision to go for snap to get a controllable enviroment.
gallery-dl can be installed as a PIP package, but nowadays you can not install any pip package system-wise - only in a virtual environment.

O! There is an Ubuntu package!

gallery-dl/plucky,plucky 1.29.3-1 all

Let me try it ...

Logging in works!!! But now I'm getting another error:

Code:
[twitter][info] No results for https://x.com/KeiHypnosis/timeline

Found this: https://github.com/mikf/gallery-dl/issues/7008
and this https://github.com/mikf/gallery-dl/blob/...terinclude
(This post was last modified: 07 Aug 2025, 01:32 by Like Ra.)
Aaand I'm stuck there. Nothing works. I could download the avatar and the background. For the rest I'm getting either "No results" or "404 Not Found" even if I see results in the browser.

Current command line:

Code:
gallery-dl -d . -v --sleep 1-10 --sleep-request 1-10 --user-agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:142.0) Gecko/20100101 Firefox/141.0" https://x.com/KeiHypnosis/

Also tried:

Code:
https://x.com/search?q=from:KeiHypnosis+include:nativetweets&f=live
https://x.com/search?filter:media&q=from:KeiHypnosis&src=typed_query"
https://x.com/search?q=from:KeiHypnosis
https://x.com/search?filter:media&q=from:KeiHypnosis&src=typed_query"

and the config file:

Code:
% cat ${HOME}/.config/gallery-dl/config.json
{
    "extractor": {
        "twitter": {
                "username": "username",
                "password": "password",
        "cookies": ["firefox","myprofile"],
                include": ["avatar","background","timeline", "media", "tweets"],
        "user-agent": "browser",
        "skip": true,
        "size": "orig"
        }
    }
}

I'm stuck ...
(This post was last modified: 07 Aug 2025, 20:01 by Like Ra.)
Probably, this is the problem:

Code:
[twitter][debug] Skipping 972584921201078272 ('Due to local laws, we are temporarily restricting access to this content until X estimates your age. Learn more')
OK, it's working now. The trick was to use the old account (made before 2013), and the correct path to the cookies file (no password is needed). So, the config and command line above are correct.

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to download YouTube (age restricted) videos Lycalopex 12 1,315 01 Aug 2025, 15:01
Last Post: Iniga
  Python script to download from erotic-hypnosis.com cinon 4 578 10 Apr 2023, 07:30
Last Post: cinon