Python uses indents to define blocks of code, and pasting it into the chat ruined my indents! Sorry about that. Wherever there's a colon (i.e. "for x in range(600):") the line below it has to be indented. Let's try again...maybe this will work. I don't post much so apologies for the formatting mistakes.
from datetime import datetime
import math
import urllib.request
from socket import timeout
epochtime = 16978870893091464654
prefix='https://vod.oc.linkv.fun/yolo-'
suffix='.m3u8'
starttime = math.floor(epochtime/10000000000) + (3600*8)
dt = datetime.utcfromtimestamp(starttime)
for x in range(600):
target=starttime+x
targetdt = datetime.utcfromtimestamp(target)
filename=prefix + str(epochtime) + '--' + targetdt.strftime('%Y%m%d%H%M%S') + suffix
try:
print(filename + urllib.request.urlopen(filename, timeout=.25).getcode())
except timeout:
continue
except:
print(filename + " found")
break
from datetime import datetime
import math
import urllib.request
from socket import timeout
epochtime = 16978870893091464654
prefix='https://vod.oc.linkv.fun/yolo-'
suffix='.m3u8'
starttime = math.floor(epochtime/10000000000) + (3600*8)
dt = datetime.utcfromtimestamp(starttime)
for x in range(600):
target=starttime+x
targetdt = datetime.utcfromtimestamp(target)
filename=prefix + str(epochtime) + '--' + targetdt.strftime('%Y%m%d%H%M%S') + suffix
try:
print(filename + urllib.request.urlopen(filename, timeout=.25).getcode())
except timeout:
continue
except:
print(filename + " found")
break
How would one change the epochtime variable?