Coder Social home page Coder Social logo

prolong / ytwrk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from riptl/ytpriv

0.0 0.0 0.0 529 KB

YT metadata exporter

Home Page: https://files.mine.terorie.dev/yt

License: GNU General Public License v3.0

Go 98.62% Python 1.12% Shell 0.27%

ytwrk's Introduction

ytwrk ๐Ÿ’พ

A fast and reliable tool for exporting YouTube data.

Features

  • Exports comments
  • Exports live chat
  • Efficient parsing using fastjson
  • Detailed access to channels and videos
  • Scripting-friendly, favors stdio and works well with mlr and jq.
  • Streaming-friendly, produces CSV/TSVs and NDJSON dumps.

If you need a large-scale data export, visit https://files.mine.terorie.dev/yt before starting a crawl.

Only use this tool to the extent permitted by the YouTube ToS.

Utility Commands

video comments [video ...]

  • Battle-tested exporter
  • Outputs an NDJSON stream
  • With positional arguments: Dumps the comments of specified videos
  • Without arguments: Reads the video IDs from stdin
  • Example ytwrk video comments < video_list.txt | jq -r '.content | .[0].text'
  • Example ytwrk video comments < video_list.txt | go run ./scripts/commments_to_csv.go | zstdmt -T8 ...

video detail <video>

  • Takes a video ID, fetches and parses it
  • Outputs some information in JSON
  • Not stable, might change

video dump

  • Outputs an NDJSON stream
  • With positional arguments: Dumps the specified videos
  • Without arguments: Reads the video IDs from stdin
  • Discovers additional videos through the related section (-n=<count> flag)
  • Optionally outputs found but not crawled videos (-r=<file> flag)
  • Remembers already crawled videos, so memory usage is O(n)
  • Not stable, might change
  • Example ytwrk video dump < video_list.txt | nc ...

video dumpraw

  • Dumps a set of videos in raw tar format
  • Useful for lossless crawls and analyzing data in-post
  • Output is a .tar archive stream
  • Reads the video IDs to dump from stdin
  • Example ytwrk video dumpraw < video_list.txt | tar -xO | jq -r '...'
  • Example ytwrk video dumpraw < video_list.txt | zstdmt -T8 ...

video parseraw

  • Consumes a tar stream produced by video dumpraw
  • Produces NDJSON like the dump command

video live chat

  • Experimental
  • Exports live chat messages

channel dump [channel_id ...]

  • Get all uploads of channels
  • Prints channel_id<TAB>video_id lines
  • With positional arguments: Dumps the specified channels
  • Without arguments: Reads the channel IDs from stdin
  • Example ytwrk channel dump < channel_list.txt > video_list.tsv

channel dumpraw

  • Dumps a set of channels in raw tar format
  • Useful for lossless crawls and analyzing data in-post
  • Output is a .tar archive stream
  • Reads the channel IDs to dump from stdin
  • Example ytwrk channel dumpraw < channel_list.txt | tar -xO | jq -r '...'
  • Example ytwrk channel dumpraw < channel_list.txt | zstdmt -T8 ...

playlist videos <playlist_id>

  • Experimental! Might change without warning
  • Writes all video IDs in the specified playlist to stdout

ytwrk's People

Contributors

dependabot-preview[bot] avatar riptl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.