Created
November 21, 2019 21:59
-
-
Save ThePrivacyCaptain/508fb809c0605fd055465bebd83368f8 to your computer and use it in GitHub Desktop.
(Dirty) Script to transform YouTube's issued OMPL subscription file to a Newsboat ready format.
This file contains 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
#!/usr/bin/python3 | |
from xml.dom import minidom | |
import sys | |
def main(): | |
doc = minidom.parse(str(sys.argv[1])) | |
for node in doc.firstChild.childNodes[1].firstChild.childNodes: | |
url = node.getAttribute("xmlUrl").split("=")[-1] | |
name = node.getAttribute("title") | |
print ('https://www.youtube.com/feeds/videos.xml?channel_id=%s "YouTube" #%s' % (url, name)) | |
if __name__ == "__main__": | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment