diff options
| author | nathansmith <nathansmith@posteo.com> | 2025-05-23 13:43:34 +0000 | 
|---|---|---|
| committer | nathansmith <nathansmith@posteo.com> | 2025-05-23 13:43:34 +0000 | 
| commit | 4e749697600bab526b1cf51bcca493f6d31d2e34 (patch) | |
| tree | 10a0274c96667d1482dd7f07d768feaf518d6187 /testTheThing/org/scripts | |
| parent | d194694f31002068868a378d121ed0e2db01c378 (diff) | |
| download | shittyweb-4e749697600bab526b1cf51bcca493f6d31d2e34.tar.gz shittyweb-4e749697600bab526b1cf51bcca493f6d31d2e34.tar.bz2 shittyweb-4e749697600bab526b1cf51bcca493f6d31d2e34.zip  | |
Almost done with this stupidness
Diffstat (limited to 'testTheThing/org/scripts')
| -rw-r--r-- | testTheThing/org/scripts/youtube_subs_export.py | 51 | 
1 files changed, 0 insertions, 51 deletions
diff --git a/testTheThing/org/scripts/youtube_subs_export.py b/testTheThing/org/scripts/youtube_subs_export.py deleted file mode 100644 index 6a36840..0000000 --- a/testTheThing/org/scripts/youtube_subs_export.py +++ /dev/null @@ -1,51 +0,0 @@ -import sys - -""" -This little script lets you export your entire youtube subscriptions list to a opml file. - -To use it go to your google account and go to your user data collection and find the part on youtube to download your subscriptions. -It will give you a subscriptions.csv file and pass that file to the script and it will output the rss opml data to stdout. -Do what you need with that data. -""" - -# XML doesn't like some characters -def fix_name(name): -    no_no_list = ["\n", '"', "&"] -    name = "".join(filter(lambda x: x not in no_no_list, name)) -    return name - -def main(): - -    # Get name of the csv file. -    if len(sys.argv) < 1: -        print("File name required") -        sys.exit() - -    file_name = sys.argv[1] - -    with open(file_name, "r") as fp: - -        print('<?xml version="1.0" encoding="UTF-8"?>') -        print('<opml version="2.0">') -        print('<head><title>OPML Feeds</title></head>') -        print('<body>') -         -        for line in fp.readlines()[1::]: # Skips the first line. - -            # Empty line. -            if line == "\n": -                continue - -            line_data = line.split(",") -            feed_url = f"https://www.youtube.com/feeds/videos.xml?channel_id={line_data[0]}" - -            print(f'\t<outline text="{fix_name(line_data[2])}" type="rss" xmlUrl="{feed_url}"/>') - - -        print('</body>') -        print('</opml>') -             - -if __name__ == "__main__": -    main() -      | 
