Giter Site home page Giter Site logo

pantsufan / yt2rss Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 5 KB

This Python script transforms NewPipe-exported YouTube subscriptions from JSON to an OPML file. Easily import and manage your favorite channels in RSS feed readers.

Python 100.00%
rss-feed rss-generator youtube youtube-rss android newpipe

yt2rss's Introduction

YT2RSS

This Python script is designed to convert your YouTube channel subscriptions from a JSON format (commonly exported from services like NewPipe) into an OPML file, which can be easily imported into various RSS feed readers.

How it works

  1. Input JSON File: The script takes as input a JSON file named newpipe-subscriptions.json, which contains information about your YouTube channel subscriptions.

  2. Extract URLs: It extracts the subscription URLs from the JSON file and modifies them to generate valid RSS feed URLs using the YouTube channel IDs.

  3. Extract Names: It also extracts the names of the YouTube channels from the JSON file.

  4. Create Text Files: The script creates two text files, urls.txt and names.txt, to store the modified URLs and channel names, respectively.

  5. Create OPML File: Finally, it generates an OPML file named feeds.opml, which includes the channel names and their corresponding RSS feed URLs.

  6. Cleanup: Temporary text files (urls.txt and names.txt) are deleted after creating the OPML file.

Usage

  1. Export NewPipe Subscriptions: First, export your YouTube channel subscriptions from NewPipe in JSON format and save the file as newpipe-subscriptions.json.

  2. Run the Script: Execute the script in the same directory where you have the newpipe-subscriptions.json file.

    python script.py
  3. Import OPML File: You can now import the generated feeds.opml file into your preferred RSS feed reader. The OPML file will contain all the YouTube channel subscriptions with their proper names.

  4. Cleanup (Optional): The script will automatically delete the temporary text files (urls.txt and names.txt) after creating the OPML file.

Important Note

  • This script is designed for use with NewPipe subscription exports. Ensure that your JSON file follows the expected format.

Feel free to customize the script or reach out for assistance if you encounter any issues. Enjoy reading your YouTube channel subscriptions in your RSS feed reader!

yt2rss's People

Contributors

pantsufan avatar

Stargazers

 avatar  avatar

Watchers

 avatar

yt2rss's Issues

Encoding Issue

Hi, thx for the fast paste script.

Just a small note, I faced issues with encodings, so I added encoding='utf-8' for all file open commands in your script to fix that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.