https://github.com/simon987/yt-metadata
Script to import youtube-dl metadata to PostgreSQL
https://github.com/simon987/yt-metadata
metadata postgresql
Last synced: about 1 year ago
JSON representation
Script to import youtube-dl metadata to PostgreSQL
- Host: GitHub
- URL: https://github.com/simon987/yt-metadata
- Owner: simon987
- License: mit
- Created: 2018-07-19T19:33:14.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-13T15:59:46.000Z (almost 8 years ago)
- Last Synced: 2025-03-21T15:00:27.429Z (about 1 year ago)
- Topics: metadata, postgresql
- Language: Python
- Size: 6.84 KB
- Stars: 14
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yt-metadata
Script to import [youtube-dl](https://github.com/rg3/youtube-dl) metadata to PostgreSQL.
The actual `.jpg` files for the thumbnails are saved into the database as byte arrays (Only the **default**
thumbnail saved by **youtube-dl**)
### Scraping metadata using youtube-dl
This tool expects the files to be in the format that this bash script will output:
```bash
id="$1"
mkdir "$id"; cd "$id"
youtube-dl -v --print-traffic --restrict-filename --write-description --write-info-json --write-annotations --write-thumbnail --all-subs --write-sub --skip-download --ignore-config --ignore-errors --geo-bypass --youtube-skip-dash-manifest https://www.youtube.com/watch?v=$id
```
### Setup instructions:
* Make sure you have PostgreSQL version **>=9.5** installed
* Create the database and schema with the tool of your choice using `schema.sql`
* Change the directory in `import.py` so it points to the location of your youtube metadata
* Run `import.py`
### Schema:
