Skip to main content

Python package to extract YouTube video titles and URLs

Project description

Automate a YouTube Channel Videos List Creation

Overview

This repo is intended to provide a quick, simple way to create a list of all videos posted to any YouTube channel by providing just the URL to that user's channel videos. The general format for this is https://www.youtube.com/user/TheChannelYouWantToScrape/videos OR
https://www.youtube.com/channel/TheChannelYouWantToScrape/videos,
with TheChannelYouWantToScrape replaced with the username of the channel.

Quick Start

git clone git@github.com:Shail-Shouryya/yt_videos_list.git
cd yt_videos_list

Running as a module

python3
from yt_videos_list import ListGenerator
LG = ListGenerator()

There are two types of YouTube channels: one type is a "user" channel and the other is a channel channel.

To scrape the video titles along with the link to the video, you need to run the generate_list(channelName, channelType) method on the ListGenerator object you just created, substituting the type of channel for channelType argument and the name of the channel for the channelName argument.

user channelType (example uses sentdex):

LG.generate_list('sentdex', 'user')

channel channelType (example uses Billie Eilish):

LG.generate_list('UCiGm_E4ZwYSHV3bcW1pnSeQ', 'channel')

Running as a script (coming soon!)

Enter the directory in which the pyYT_videos_list.py and execute.py exist (they should both be in the same directory to avoid refernce issues), and run the following command from your command line

python3 yt_videos_list

You should see the following:

What is the name of the YouTube channel you want to generate the list for?
If you're unsure, click on the channel and look at the URL.
It should be in the format:
https://www.youtube.com/user/YourChannelName
OR
https://www.youtube.com/channel/YourChannelName
Substitute what you see for YourChannelName and type it in below:

Enter the name of the channel or user that you wish to scrape, and the program will do the rest for you!

Program Functionality

Main Features

  • take url and scrape the video name and url for every video for that user
  • create csv
  • get date published (probably not possible without significantly increasing runtime, could get how long ago video was published, but that tends to be unspecific)

Additional Features

  • create web interface
    • input box for channel url
  • ouput CSV with custom name
  • generate static HTML page with video URLs
  • update previously generated CSV with new videos uploaded since CSV generation
    • using some kind of delta sync

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yt_videos_list-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file yt_videos_list-0.1.1.tar.gz.

File metadata

  • Download URL: yt_videos_list-0.1.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for yt_videos_list-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bb060ab15d8a146e5d53246d883294d97a70bda60fd9ab6161ff501a87f2dc0e
MD5 1acb5b36eba899481f053e02f9b3261b
BLAKE2b-256 969f678a3ac3495491cf7aee95aca2fad686906363324324be4b51cecb05b274

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page