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
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)
- Video info
-
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)
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
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
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
A online docs is hosted in Github Pages
- Usage guide (not only Nim)
- Make requests async
- Use API https://www.youtube.com/youtubei/v1/browse to get channel data instead using simple page request
- Add tests for captions sub module
Python3 parser
With a "How it works" section
MIT