Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

A multi-processing supported twitter video downloader

License

Notifications You must be signed in to change notification settings

code-yeongyu/TwitterVideoTools

Repository files navigation

This project is deprecated. Please look at https://github.com/code-yeongyu/twitter_video_tools_v2

Twitter Video Tools

PyPI version Test codecov

  • A multi-processing supported video downloader
  • supports downloading videos from twitter (or specific user from twitter) && monsnode.

Install

with PIP

pip install twitter-video-tools

with Poetry

poetry add twitter-video-tools

Usage

Command line

python3 -m twitter_video_tools [link]

Supported link types:

Python Embedding

from twitter_video_tools import TwitterVideoTools

with TwitterVideoTools() as twitter_video_tools:
    twitter_video_tools.download_from_user('twtvtOfficial')

Contribution

Prerequisites

  • Python 3.9
  • poetry
  • code editor (vscode recommended)

Overview of Development Environments

All-in-one

gh repo clone code-yeongyu/twitter_video_tools
python3 -m pip install poetry
poetry install # install dependencies
code --install-extension emeraldwalk.RunOnSave # to force single quote
code --install-extension tamasfe.even-better-toml # for handling toml

Done!

Test

poetry shell
inv test

Inspirations

  • Inspired me to start this project. yt-dlp is a fork project of youtube-dl.
  • Since the cookie option of yt-dlp's twitter extractor is not working, I decided to make my own project, using browser automation.
  • Microsoft's browser automation module.
  • Another major project to made me to start this project. I made up my mind to make TwitterVideoTools to experience playwright.
  • It would be so painful to imagine making this project with selenium, but I enjoyed a lot while writing the twitter crawler part thanks to playwright.
  • Ever since I started this project, I always wanted to support CLI with typer's awesome development experience.
  • TwitterVideoTools' CLI is written with typer, and it is so beautiful and easy to use at the same time.
  • These three tools helped me to write fully-typed python code.
  • I won't start my python project without these tools.
  • I made this template to make my python project development experience better.
    • Safe & Convient development environment
      • Strict type checking
      • Amazing linters & formatters
      • Unit test supported
  • This project is also based on this template.