Advertisement
peanutstick

Get_streaming_links

Dec 5th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.72 KB | None | 0 0
  1. from urllib.request import Request, urlopen
  2. import re
  3. import os
  4. ##################################################################
  5. #### Creator: Peanutstick #### why: To seduce my ro... nvm     ###
  6. ##################################################################
  7. ### This script gona generate HTML file with links of          ###
  8. ### streaming or torrent web-site                              ###
  9. ##################################################################
  10. google = "https://www.google.fr/search?q="
  11. film = str(input("Can I have you'r request Sir? \n:"))
  12. film = film.replace(" ","+") # replace space by + cuz google don't like space
  13. req = Request(google+film+"+streaming", headers={'User-Agent': 'Mozilla/5.0'})
  14. webpage = urlopen(req).read()
  15. links = re.findall(r'https://lumendatabase.org/(.*?)&amp', str(webpage))#take all links (just half cuz i'm bad in regex)
  16. i = 1
  17. for link in links:
  18.     link = "https://lumendatabase.org/"+link #I complet the link (cuz I'm ... nvm)
  19.     print(str(i)+" : " +link) # just print something to show what it's going one
  20.     req = Request(link, headers={'User-Agent': 'Mozilla/5.0'})
  21.     webpage = urlopen(req).read().decode('utf-8')    
  22.     sitestream = re.findall(r'infringing_url">(.*?) - ', webpage)
  23.     fichier = open(str(i)+" - "+film+".html", "a")
  24.     for site in sitestream: #for each url ...
  25.         if site == "[REDACTED]": # I look if the file gone be empty
  26.             fichier.close() #close and delet the file
  27.             os.remove(str(i)+" - "+film+".html")
  28.             break
  29.         else:
  30.             fichier.write("<a href=http://"+site+">"+site+"</a><br>") # else I put all links in my file
  31.     fichier.close()
  32.     i = i + 1# this is the number of my html file
  33.    
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement