Convert your Google subscriptions CSV file into a valid JSON for Newpipe!
Thanks to nikcorg for sharing how to convert the CSV into a NewPipe valid JSON. This is an automation of his guide.
- First of all, the 3 column names of the CSV must be changed to service_id,url,name.
- Then, all "http" ocurrencies have to be changed changed to "https".
- After that, the parsed CSV is converted into a JSON, that is appended into a empty list in the NewPipe JSON header {"app_version":"x.xx.x","app_version_int":xxx"","subscriptions":[]} .
NOTE: No requirements needed, as they are already in the python standart lib
You will get something like:
{"app_version":"0.21.7","app_version_int":973,"subscriptions":[]}
Those are the headers needed to convert the CSV into a NewPipe valid JSON, as the version declared in the JSON must coincide with the NewPipe app version.
$ python3 fixer.py -f [filename.csv] -j [header.json]
If you're on Windows and you're not used to using the terminal, you can execute instead:
friendlyFixer.cmd
- -f / --file (The csv that contains the subscriptions)
- -j / --jsonHeader (The exported json from NewPipe that includes the headers)
- -e / --encoding (To specify the file encoding)
$ python3 fixer.py -f [filename.csv] -j [header.json] -e "cp437"
juandarr has done a website alternative for this script. It may be more convenient for some people, specially for those who are not used to using the terminal.