Advertisement
Guest User

Untitled

a guest
Nov 18th, 2020
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import requests
  2. import time
  3. import datetime
  4.  
  5. print('podaj link do nagrania')
  6. link = input()
  7. print('dzień nagrania')
  8. data_day = input()
  9. print('miesiąc nagrania')
  10. data_month = input()
  11. print('rok nagrania')
  12. data_year = input()
  13. print('godzina nagrania')
  14. data_hour = input()
  15. print('minuty nagrania')
  16. data_min = input()
  17. print('długość nagrania w minutach')
  18. long = int(input())*60
  19. data = (data_day+'/'+data_month+'/'+data_year+' '+data_hour+':'+data_min)
  20. data1 = ''.join(data)
  21. element = datetime.datetime.strptime(data1,'%d/%m/%Y %H:%M')
  22. timestamp = datetime.datetime.timestamp(element)
  23. rectime2 = '?utc='
  24. firstlink = (link+rectime2)+str(int(timestamp))
  25. r = requests.get(firstlink, timeout=1, stream=True)
  26. link2 = (r.url)
  27. x = link2.split('/')
  28. x1 = (x[0]+'//'+x[2]+'/'+x[3]+'/index-'+str(int(timestamp))+'-'+str(long)+'.mp4?')
  29. y = (x[4])
  30. z = y.split('?')
  31. z1= x1+z[1]
  32. print(z1)
  33. input("zamknij Enter")
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement