Created
March 24, 2022 12:10
-
-
Save kisPocok/8ebda82c2c4b959907d6c83990560e42 to your computer and use it in GitHub Desktop.
$ python ./youtube-playlist-generator.py
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
import os, io | |
import webbrowser | |
import urllib2 | |
inputFileName = './youtube-video-list.txt' | |
def ReadMultipleDataFrom(thisTextFile, thisPattern): | |
inputData = [] | |
file = open(thisTextFile, "r") | |
for iLine in file: | |
if iLine.startswith(thisPattern): | |
iLine = iLine.rstrip() | |
# print iLine | |
if ('v=') in iLine: # https://www.youtube.com/watch?v=aBcDeFGH | |
iLink = iLine.split('v=')[1] | |
inputData.append(iLink) | |
if ('be/') in iLine: # https://youtu.be/aBcDeFGH | |
iLink = iLine.split('be/')[1] | |
inputData.append(iLink) | |
return inputData | |
videoLinks = ReadMultipleDataFrom(inputFileName, "https") | |
# print videoLinks | |
listOfVideos = "http://www.youtube.com/watch_videos?video_ids=" + ','.join(videoLinks) | |
# print listOfVideos | |
response = urllib2.urlopen(listOfVideos) | |
playListLink = response.geturl() | |
# print playListLink | |
playListLink = playListLink.split('list=')[1] | |
#print playListLink | |
playListURL = "https://www.youtube.com/playlist?list="+playListLink+"&disable_polymer=true" | |
print playListURL | |
webbrowser.open(playListURL) |
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
https://www.youtube.com/watch?v=JCJUL3mcVWw | |
https://www.youtube.com/watch?v=GoSq-yZcJ-4 | |
https://www.youtube.com/watch?v=pWepfJ-8XU0 | |
https://www.youtube.com/watch?v=NNELmTbw9yM | |
https://www.youtube.com/watch?v=TC0xyMOy8xA | |
https://www.youtube.com/watch?v=zGeqT_sDTJ8 | |
https://www.youtube.com/watch?v=iDVJZlr3LM0 | |
https://www.youtube.com/watch?v=QBD7CB-rroo | |
https://www.youtube.com/watch?v=ZMnGolLNpR0 | |
https://www.youtube.com/watch?v=ug1pI-Ephns | |
https://www.youtube.com/watch?v=-jBfb33_KHU | |
https://www.youtube.com/watch?v=vrfCD9wjLUE | |
https://www.youtube.com/watch?v=qNJRGHk7sN8 | |
https://www.youtube.com/watch?v=BdrZWu2dZ4c | |
https://www.youtube.com/watch?v=CaOXGbR1jkg | |
https://www.youtube.com/watch?v=GzrjwOQpAl0 | |
https://www.youtube.com/watch?v=Vr-L6q4vbWU | |
https://www.youtube.com/watch?v=JkiglO98YYo | |
https://www.youtube.com/watch?v=mGAYzlqj-aE | |
https://www.youtube.com/watch?v=FPGOe7KnopI | |
https://www.youtube.com/watch?v=hNkvV4PR-q0 | |
https://www.youtube.com/watch?v=yLTRzrDeVEA | |
https://www.youtube.com/watch?v=tbbKjDjMDok | |
https://www.youtube.com/watch?v=yCjJyiqpAuU | |
https://www.youtube.com/watch?v=ZpJCgTx_auc | |
https://www.youtube.com/watch?v=e7anywNwU58 | |
https://www.youtube.com/watch?v=U_uN3jy9Cc8 | |
https://www.youtube.com/watch?v=bBt-IyO930c | |
https://www.youtube.com/watch?v=_Ir0Mc6Qilo | |
https://www.youtube.com/watch?v=lCPJhybHBkA | |
https://www.youtube.com/watch?v=JV-D_K4drsA | |
https://www.youtube.com/watch?v=XGIA2bHy13g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment