Skip to content

WilsonMJ/CopyTube

Repository files navigation

Description

This script was created with the motivation of wanting to be able to add DMCA free songs to an already existing public playlist of DMCA free songs for use with streaming. The downside of manually doing this process was having to click Add to Playlist on each video in the existing playlist to be able to add other songs I found I liked not already in the playlist.

The script was created using Python and YouTube's Data V3 API.

Requirements

  • Python 3.6+
  • Pip
  • YouTube API key and client_secrets file
    • Walkthrough for obtaining these credentials can be found here
  • Google account

Configuration

  1. Add API key and client_secrets filename to config.py

    • client_secrets file should be in the same directory as copytube.py

    config.py configuration

  2. Set up a python virtual environment and activate

  3. Install modules needed using pip

    • pip install -r requirements.txt

    Virtual Environment and Pip install

Usage

  1. Start CopyTube

    • python3 copytube.py

    CopyTube Start

  2. Retrieve YouTube URL of playlist to be copied

    YouTube Playlist URL

  3. Enter YouTube URL to prompt

    Youtube URL in prompt

  4. Click on authorization link and log into the account of new playlist destination.

    • You will see a warning for the application being unverified. Due to having set up the API client with your own credentials, you can click on Advanced, at which point you should see your email address, and click Go to CopyTube (unsafe)

    Warning page

  5. After clicking you will receive permission requests for CopyTube to be able to use your YouTube account. Click Allow, copy the authorization code provided, and paste into CopyTube's prompt.

    Permissions

    Authorization Code

    Copied code

  6. A progress bar should appear showing the progress of the songs being copied

    • Upon finishing, the prompt will provide you with a link to the new playlist
    • If a 500 server error is sent, repeat steps 1 through 5.
    • Note that playlists exceeding 195 songs will be cut off at 195 and if multiple attempts have been made in one day the 195 limit will potentially be less

    Progress bar in action

    Progress bar finished

Limitations

The biggest limitation for this script is the API quota limit. YouTube currently allows 10,000 quota units per day, and creating a new playlist and inserting videos to a playlist are costly requests (50 quota units per request).

Another limitation to using this script is having to set up your own credentials to use with the API. I was unable to find a way to allow for a more easy setup without exposing my API key and allowing unauthorized use to it.

A last issue that I have found to pop up occasionally is a 500 server error sent by the API with little description as to the issue. Upon rerunning the same script the operations function properly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages