Skip to content

thisago/ytextractor

Repository files navigation

ytextractor

Note: An new version with async, NodeJS support and more fixes are in development at branch dev-v1.2

Youtube data extractor

Extracts the data of a Youtube url. but more will be added soon!

The objective is extract every data that don't need authentication


Features

Extracted Info
  • Video url

    • Video info
      • Id (video code)
      • Title
      • Description
      • Thumbnails
      • Embed
      • Publish date
      • Upload date
      • Length
      • Family friendly
      • Unlisted
      • Private
      • Live (is live)
      • Channel
      • Views
      • Category
      • Likes
      • Keywords
      • Captions URLs
    • Channel
      • Name
      • Id
      • Url
      • Subscribers
      • Channel icons
      • Hidden subscribers (bool)
  • Channel url

    • Id
    • Url
    • Name
    • Subscribers
    • Channel icons
    • Hidden subscribers (bool)
    • Family safe
    • Tags
    • Description (about)
    • Banners
    • Links
      • Primary
      • Secondary
    • Highlighted playlists videos
    • Highlighted video
      • Id (video code)
      • Title
      • Description
      • Thumbnails
      • Views
      • Rounded publish date
      • Badges
        • Name
        • Icon
        • IconType
        • Style
  • Video captions

  • Video data

    • Subtitles
    • Comments
      • Comments of comments
    • Livechat
      • Realtime
      • Replay
  • Search results

  • All videos from channel/user

  • All videos of playlist (a seq of videos)

JS (browser) target avaliable!

Online example

An example can be found in examples/web.

Unfortunately the implementation isn't async, soon it will be fixed

TODO: Add captions extraction to JS example


Usage

import ytextractor
echo extractVideo "7on15IWC2u4"

or

import ytextractor
var vid = initYoutubeVideo "7on15IWC2u4".videoId
discard vid.update()
echo vid

import ytextractor
echo extractChannel "https://www.youtube.com/c/taofledermaus"

or

import ytextractor
var channel = initYoutubeChannel "https://www.youtube.com/c/taofledermaus".channelId
discard channel.update(home)
echo channel

import ytextractor
echo "7on15IWC2u4".extractVideo.captions[0].url.extractCaptions

or

import ytextractor
var captions = initYoutubecaptions()
discard captions.update "7on15IWC2u4".extractVideo.captions[0].url
echo captions

Installation

Minimum Nim version is 1.2.2

Please choice one installation method:

  • Automatically with nimble
    nimble install ytextractor

Or

  • Manually
    git clone https://github.com/thisago/ytextractor
    cd ytextractor/
    nimble install

Docs

A online docs is hosted in Github Pages


TODO


Useful links

Python3 parser
With a "How it works" section


License

MIT