Guest User

program do generowania linków iptv

a guest
Oct 19th, 2020
125
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #python3
  2. # coding: utf-8
  3. #Program do generowania linków z teleelevidenie
  4.  
  5. #Konwersja daty na timestamp
  6.  
  7. import time
  8. import datetime
  9.  
  10. print ('data i godzina rozpoczęcia nagrania w formacie dd.mm.rrrr hh.mm')
  11. data=str(input())
  12.  
  13.  
  14. element = datetime.datetime.strptime(data,'%d.%m.%Y %H.%M')
  15.  
  16. timestamp = datetime.datetime.timestamp(element)
  17.  
  18. #Ankieta
  19.  
  20. print()
  21. print('długość nagrywania w minutach')
  22. rec_time = int(input())*60
  23. print()
  24. print('podaj swój token')
  25. token=input()
  26. #token=''
  27. print()
  28. print('program tv jaki chcesz nagrać (np. tvp1 hd, tvp rozrywka, super polsat hd, tvn7 hd, tv4 hd, tlc hd, puls2, wp, polsat hd, canal hd, tvn hd, tvp polonia, tv6 hd, tvp hd, tvn7 hd, tvp seriale, metro, zoom tv, tvp2 hd, tv puls hd, ttv hd, tvp kultura, polsat2 hd, tvp sport hd)')
  29. print()
  30. text = input().upper()
  31. tvprogram = text.replace(" ","_")
  32.  
  33. linkpart=('.teleelevidenie.com/PL_'+tvprogram+'/index-'+str(int(timestamp))+'-'+str(rec_time)+'.mp4?token='+token)
  34. print()
  35.  
  36. #Zbiory serwerów
  37.  
  38. cloud1 = {'TV4_HD'}
  39. cloud2 = {'TLC_HD','PULS2','WP'}
  40. cloud11 = {'POLSAT_HD','CANAL_HD','TVP_ROZRYWKA'}
  41. cloud13 = {'NOWA_TV'}
  42. cloud14 = {'TVN_HD','TVP_POLONIA','TV6_HD'}
  43. cloud15 = {'TVP_HD','TVN7_HD','TVP_SERIALE','METRO','ZOOM_TV'}
  44. cloud16 = {'TVP1_HD','TVP2_HD','TV_PULS_HD','TTV_HD','TVP_KULTURA'}
  45. cloud17 = {'SUPER_POLSAT_HD','POLSAT2_HD'}
  46. cloud20 = {'TVP_SPORT_HD'}
  47.  
  48. #Generowanie linku
  49.  
  50. print('skopiuj link')
  51. print()
  52. if tvprogram in cloud1:
  53. print('https://cloud1'+linkpart)
  54. elif tvprogram in cloud2:
  55. print('https://cloud2'+linkpart)
  56. elif tvprogram in cloud11:
  57. print('https://cloud11'+linkpart)
  58. elif tvprogram in cloud13:
  59. print('https://cloud13'+linkpart)
  60. elif tvprogram in cloud14:
  61. print('https://cloud14'+linkpart)
  62. elif tvprogram in cloud15:
  63. print('https://cloud15'+linkpart)
  64. elif tvprogram in cloud16:
  65. print('https://cloud16'+linkpart)
  66. elif tvprogram in cloud17:
  67. print('https://cloud17'+linkpart)
  68. elif tvprogram in cloud20:
  69. print('https://cloud20'+linkpart)
  70. else:
  71. print('nie mam takiego programu w bazie')
  72. print()
  73.  
  74. input ("zamknij Enter")
  75.  
RAW Paste Data