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] --dump-user-json, --dump-json without post information #3623

Open
Scripter17 opened this issue Feb 6, 2023 · 3 comments
Open

Comments

@Scripter17
Copy link
Contributor

I'm trying to automatically get people's alt/other website accounts, but when I do gallery-dl --dump-json https://twitter.com/username it gets all the tweets it would when downloading https://twitter.com/username

Basically the idea is that --dump-user-json returns just the "user" part of what is written to metadata files

Using --range 0 is usually good enough but would fail if the user never posted anything

@Scripter17 Scripter17 changed the title --dump-user-json, --dump-json without post information [Feature request] --dump-user-json, --dump-json without post information Feb 6, 2023
@ClosedPort22
Copy link
Contributor

ClosedPort22 commented Feb 6, 2023

You can use gallery-dl --write-pages --filter 'abort()' https://twitter.com/elonmusk/photo to save user data as TXT files in your working directory.

--write-pages dumps the response
/photo prevents additional API requests
--filter 'abort()' aborts the current download job before downloading the user's profile picture

@mikf
Copy link
Owner

mikf commented Feb 9, 2023

Implementing this is not possible with the current code base.

You'll have to wait for v2 for that, or you write a small Python script that uses gallery-dl's TwitterAPI code.

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
from gallery_dl.util import dump_json
from gallery_dl.extractor import twitter

extr = twitter.TwitterTweetExtractor.from_url("twitter.com/i/status/1")
api = twitter.TwitterAPI(extr)

name = sys.argv[1]
user = api.user_by_screen_name(name)
dump_json(user)

@mikf
Copy link
Owner

mikf commented Jul 9, 2024

For the time being, you can use /USER/profile as URL together with --dump-json to get user profile information and nothing else (c2bf4ff).

I might change the name and URL path, but I'm not really sure what would fit best here. (#5262 (comment))

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

3 participants