Last active
October 20, 2019 15:42
-
-
Save Ezbob/04c3f877c321328fb21ceaaebb5360c2 to your computer and use it in GitHub Desktop.
Get youtube links from favorites takeout json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import sys | |
import json | |
import pathlib | |
if len(sys.argv) <= 1: | |
print("Error: Expected one argument; path to Favorite file") | |
exit(1) | |
path = pathlib.Path(sys.argv[1]) | |
with path.open(mode="r", encoding="utf-8") as fin: | |
for entry in json.load(fin): | |
print("https://www.youtube.com/watch?v={}".format(entry["contentDetails"]["videoId"])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment