Skip to content

Instantly share code, notes, and snippets.

@ThePrivacyCaptain
Created November 21, 2019 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThePrivacyCaptain/508fb809c0605fd055465bebd83368f8 to your computer and use it in GitHub Desktop.
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.
#!/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