Advertisement
here2share

# youtube-dl_backtrack.py

Oct 28th, 2016
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. # youtube-dl_backtrack.py ^ when past expiry
  2.  
  3. import win32clipboard
  4.  
  5. win32clipboard.OpenClipboard()
  6. data = win32clipboard.GetClipboardData()
  7. win32clipboard.CloseClipboard()
  8.  
  9. yt="https://www.youtube.com/watch?v="
  10.  
  11. bbb=[]
  12. for z in data.splitlines():
  13.     z=z.split('video_id=')[-1]
  14.     z=z.split('&t=')[0]
  15.     bbb.append(yt+z)
  16. #
  17. web="""<!DOCTYPE html>
  18. <html>
  19. <head></head>
  20. <body><p>@</p></body>
  21. </html>"""
  22.  
  23. ccc='<br>'.join(bbb)
  24.  
  25. import tempfile
  26. import webbrowser
  27.  
  28. srcfilename=tempfile.mktemp(".html", "demo_")
  29. temp=open(srcfilename, 'w')
  30. temp.write(web.replace('@',ccc))
  31.  
  32. webbrowser.open_new_tab(srcfilename)
  33. temp.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement