Skip to content
프로젝트

Spark-NF/twitter_media_downloader

GitHub에서 보기

소개

Twitter media downloader.

디자인 및 미디어

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
-1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Twitter media downloader

GitHub issues Build status Code Coverage Project license

About

Downloads all videos and images from a Twitter account.

Supports downloading an user's tweets, retweets, and likes.

Usage

twitter_media_downloader.py [-h] [-o DIR] [-f FORMAT] [-s IMAGE_SIZE] [-r] [-u] [-q] userid [...]

On first run, the program will ask you for your OAuth consumer key and consumer secret. It will then be stored in a .oauth.json file so that you don't need to enter them every single time. It will also ask your access token and access token secret. Those are only required if you are planning to access protected accounts.

Arguments

  • userid: the account name or ID (1 or more), if it starts with a @ it will be opened as a file (one account per line)
  • -h, --help: show the help and exit
  • -o DIR, --output DIR: set the output directory where medias will be downloaded
  • -f FORMAT, --format FORMAT: the filename format, see below for the available tokens to use
  • -s IMAGE_SIZE, --image-size IMAGE_SIZE: the preferred image size to download, will fallback to the default size if not available
  • --since DATE: the start date of the search, accepted formats: YYYY-mm-dd HH:MM and YYYY-mm-dd (defaults to 00:00)
  • --since-id ID: the start ID of the search (exclusive)
  • --until DATE: the end date of the search, accepted formats: YYYY-mm-dd HH:MM and YYYY-mm-dd (defaults to 00:00)
  • --until-id ID: the end ID of the search (inclusive)
  • -r, --retweets: also download medias from retweets
  • -l, --likes: download an user's likes instead of its tweets
  • -u, --userid: append the userid to the output directory
  • -q, --quiet: disable output

Example

python twitter_media_downloader.py -o out -f "[%date%] %filename%.%ext%" -s large -u Twitter

Will download all of the Twitter account media files into the out/Twitter/ directory, each file named like [2017-01-11 05-56-33] C13U6d-VQAAVKeY.jpg.

Available tokens for format

  • tweet_id: the tweet identifier (original_tweet_id for retweets)
  • date: the tweet post date (original_date for retweets)
  • user_id: the tweet author ID (original_user_id for retweets)
  • user_name: the tweet author name (original_user_name for retweets)
  • user_screen_name: the tweet author screen name / username (original_user_screen_name for retweets)
  • filename: the file filename on the server
  • ext: the file extension
  • type: "tweet" or "retweet"

Authors

License

The program is licensed under the Apache License 2.0.

관련 프로젝트 살펴보기

불러오는 중…