Skip to content

damir-cuturic/ypb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME
    ypb - YouTube Playlist Backup script

SYNOPSIS
    ypb.py
    ypb.py [-h]
    ypb.py [-i ID]
    ypb.py [-u USERNAME]
    ypb.py [-r]

DESCRIPTION
    ypb is a Python script which retrieves the playlists of a YouTube channel.
    It uses YouTube Data API v3 for accessing the channel's information, and
    is implemented using the Google API Client Library for Python. Complete
    backups of public and/or private playlists are possible. Playlist
    information is sent to stdout.

    Note: This is not a YouTube video downloader. The purpose of the script is
    for recording playlist information, which is useful when videos are
    unexpectedly deleted from YouTube.

USAGE
    There are three ways to use the script. Without arguments, ypb will
    retrieve all of the user's playlists, including private ones. This method
    requires that the user allow access to their YouTube account. The script
    uses the OAuth 2.0 protocol for this purpose. It will direct the user to
    an authentication page using a web browser, at which point they may allow
    access through Google's authorization server.

    With the -i option, the supplied channel ID is used to retrieve only
    public playlists. No authorization process is required for this method.

    With the -u option, the supplied YouTube username is used to retrieve only
    public playlists. No authorization process is required for this method.

OPTIONS
    -h, --help
        Show the help message and exit.

    -i, --id
        Retrieve public playlists for the supplied YouTube channel ID. No
        authentication is required. The channel ID is embedded in the URL when
        accessing channel-related content, e.g. youtube.com/channel/CHANNELID.
        It may also be viewed via My Channel or by accessing YouTube settings
        -> Advanced -> Account Information.

    -u, --username
        Retrieve public playlists for the supplied legacy YouTube username. No
        authentication is required. Usernames were used by YouTube before it
        was acquired by Google, although they are still supported for older
        accounts. Usernames should not be confused with display names, which
        do not uniquely identify a channel.

    -r, --related
        Retrieve related playlists in addition to standard playlists. Related
        playlists record metadata associated with a channel. These include
        likes, favorites, uploads, watch later and history. The watch later
        and history playlists may only be retrieved via authenticated
        requests.

CREDENTIALS
    To communicate with YouTube Data API the script requires proper
    authorization credentials. Since the keys and files required for
    authorization are not provided, it is up to the user to obtain them. For
    authenticated requests, the client-secrets.json file is required. For
    non-authenticated requests, an API key is required. Please see
    https://developers.google.com/youtube/registering_an_application for more
    information regarding authorization credentials.

CONFIGURATION
    The configuration file config.py stores authorization credentials and
    options for controlling ypb. All options specified on the command line
    supersede any stored in config.py.

REQUIREMENTS
    Python 2.7
    google-api-python-client

FILES
    config.py
        Configuration file for authorization credentials and options.

    resources.py
        Module containing classes, functions, and settings.

    client-secrets.json
        Required for authenticated requests. See CREDENTIALS.

    ypb.py-oauth2.json
        Created during authenticated requests. See CREDENTIALS.

AUTHOR
    Roberto Gomez, Jr.

About

YouTube Playlist Backup script

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%