GithubHelp home page GithubHelp logo

chrrel / youtube-playlist-exporter Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 2.0 197 KB

This is a python tool for exporting playlists from your YouTube account. It allows to import playlist data from CSV files and exports all playlists to a simple, browsable HTML web page.

License: GNU General Public License v3.0

Python 70.10% JavaScript 7.35% CSS 18.56% HTML 3.98%
invidious playlist youtube youtube-playlist youtube-playlist-backup youtube-playlist-export

youtube-playlist-exporter's Introduction

YouTube Playlist Exporter

This is a python tool for exporting playlists from your YouTube account. It allows to import playlist data from CSV files and exports all playlists to a simple, browsable HTML web page as well as a JSON file.

Screenshot

YouTube data exported via Google Takeout does not contain much information on the videos within a playlist. Therefore, this tool uses the Invidious REST API to retrieve additional data on each video (e.g. title, duration and thumbnail) and saves this locally. This allows to keep an easy-to-use copy of your YouTube playlist even if you delete your YouTube account. Note that the videos are not downloaded.

Usage

  1. Download your YouTube data using Google Takeout. This will yield a zip file containing CSV files, one for each playlist.
  2. Supply all configuration values, especially the path to your CSV files, in config.cfg.
  3. Execute the script by running python3 main.py.

License

This project is licensed under the GNU General Public License v3.0.

This project is not endorsed or certified by YouTube / Google LLC.

youtube-playlist-exporter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

youtube-playlist-exporter's Issues

bug minus ID glitch

Hi chrrel, thank you for sharing this wonderful tool. I've just backed up my 150 playlists in 2 batches.
Me reporting some bug, seems like video IDs starting with minus sign are not processed correctly, script is putting space to the beginning.

https://www.youtube.com/watch?v=-UGmleOV42Y

image

YT export changes :)

Guten Tag Christian,
YT has changed data structure, now playlist metadata is not in CSV file and all playlists metadata are in separate csv file named "playlists.csv".

Here is my quick messy patch, just to make it work, I don't code in py:
utils.py, replace function get_playlist_from_csv

def get_playlist_from_csv(csv_file_name: str) -> dict:
with open(csv_file_name, encoding="utf-8", newline="") as csvfile:
data = csvfile.readlines()
playlist_content_data = list(csv.reader(data[1:], delimiter=","))
title = csv_file_name.replace("-videos.csv", "")
title = title.replace("../data/playlists\", "")
id = title.replace(" ", "")

    playlist = {
        "id": id,
        "channel_id": "",
        "time_updated": "",
        "time_created": "",
        "title": title,
        "description": "",
        "visibility": "",
        "videos": [{"id": video[0], "time_added": video[1]} for video in playlist_content_data if len(video) > 1],
    }
    return playlist

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.