Skip to content

My first Perl program. Allows one to "subscribe" to playlists one youtube. New videos are downloaded every time program is run.

License

Notifications You must be signed in to change notification settings

cab-1729/Youtube-Subscribe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Youtube-Subscribe

My first Perl program, created for personal use and with the intent to learn Perl. Allows one to "subscribe" to playlists on youtube. New videos are downloaded every time program is run. The configuration is done in the Subscribed.pm file.

Usage

  • Store you Done.pm and Subscribed.pm in ~/.config/youtube.
  • Run the youtube.pl file.
  • There will be a pause after each video title is shown:
y -> Yes (download this)
n -> No (Ignore this)
d -> Show the description of the video and ask for input again

Important details:

  • Requires Youtube Data API key.
  • Downloads videos locally.
  • Remembers last videos using the Done.pm file.
  • Done.pm is changed everytime the program is run, so it should be given read and write permissions.
  • Topics are not downloaded in any specific order. (for now)
  • Since the program is configured in Perl, usage requires moderate knowledge of Perl.
  • By default yt-dlp is used to download videos. One may change that or change the flags yt-dlp is run with by editing the download subroutine in Subscribed.pm.
  • Of course, this is for Unix based operating systems only.
  • Done.pm is to be configured once. This includes the last video that was asked from each playlist. When running another time, videos uploaded after that video will be checked.
  • Assumes you haven't missed more than 50 videos for convenience.

About Subscribed.pm

  • This file can be thought of as the "config file" of the program.
  • Each topic is a data member of the package which is a 2d array.
  • Each playlist is an array belonging to a topic.
  • Playlists have three elements, last one being optional.
  • The first 2 elements of a playlist are the name and the Id respectively, third element is the directory in which the videos are to be downloaded.
  • If the third element is left blank, videos will be downloaded to the Downloads directory of the current user.
  • The name of the playlist can be anything, it does not have to match the actual name.
  • The api_key subroutine returns the Youtube Data API key. Users are required to write this function themselves based on how the key is stored on their system.
  • The download subroutine will be called on each video id.

Tip: If one wants to subscribe to a channel. Get a hold of the channel id, replace the leading 'UC' with 'UU'. The resulting string is the ID of a playlist containing all of the channels videos.

Contributing

Not actively looking for contributors, but any pull request is welcome. No hard feelings if I don't agree with you, you can live with your own fork.

About

My first Perl program. Allows one to "subscribe" to playlists one youtube. New videos are downloaded every time program is run.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages