SolvedNewPipe YouTube subscriptions cannot be imported (seem to be exported as .csv now)
βοΈAccepted Answer
Also running into this.
I believe https://github.com/TeamNewPipe/NewPipeExtractor/blob/dev/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeSubscriptionExtractor.java is the file to modify to support csv exports.
Here is a python script that converts from the csv format to the old json format:
import pandas as pd
df = pd.read_csv('subscriptions.csv')
subs_list = [
dict(snippet=dict(
resourceId=dict(
channelId=r["Channel Id"]
),
title=r["Channel Title"]
))
for _, r in df.iterrows()
]
import json
with open('subscriptions.json', 'w') as f:
json.dump(subs_list, f)
Other Answers:
https://tbjgolden.github.io/newpipe-csv-json-fixer/
Simple solution for non-technical people - converts your subscriptions.csv files to subscriptions.json on the web page.
@talanc @KuroInside @NioAntoVenice this solution should work for non-English language YouTube users
Source code: https://github.com/tbjgolden/newpipe-csv-json-fixer
I remembered that for Windows users, PowerShell comes pre-installed and can work with CSV and JSON out of the box.
I wrote this short pipeline to try it out:
Import-Csv .\subscriptions.csv | ForEach-Object {
@{
snippet = @{
resourceId = @{
channelId = $_.'Channel Id'
};
title = $_.'Channel Title'
}
}
} | ConvertTo-Json -Depth 100 | Out-File -Encoding utf8 .\subscriptions.json
To use this:
- In File Explorer, navigate to the folder where your ''subscriptions.csv'' lives
- File β Open Windows PowerShell
- Paste the above snippet (Ctrl+V or just Right Click) and press Enter
Easy!
NewPipe seems to handle it fine the resulting ''subscriptions.json'' for me. Let me know if it works for you if you try it out!
@Kommynct That is bizarre. Your column labels are slightly different from mine:
Channel Id,Channel Url,Channel Title
UC-3SbfTPJsL8fJAPKiVqBLg,http://www.youtube.com/channel/UC-3SbfTPJsL8fJAPKiVqBLg,Deep Look
Here's a fixed version of the script (it normalizes the column names to be all lowercase first):
import pandas as pd
df = pd.read_csv('subscriptions.csv')
df.columns= df.columns.str.lower()
subs_list = [
dict(snippet=dict(
resourceId=dict(
channelId=r["channel id"]
),
title=r["channel title"]
))
for _, r in df.iterrows()
]
import json
with open('subscriptions.json', 'w') as f:
json.dump(subs_list, f)
@tbjgolden could you at least post the source code? It's not really feasible to see how the script works, as it's minified.
updated: https://gist.github.com/tbjgolden/72bf7595a8338772516cf6b3968d69c9#gistcomment-3842080
I wanted to import my YouTube subscriptions and followed the instructions. The thing is that the file that YouTube creates in the .zip is a .csv file. That cannot be imported to NewPipe. I've also tried changing the file type to .json, but that does not work either.
Device info