-
Notifications
You must be signed in to change notification settings - Fork 0
/
LINK.PY
37 lines (27 loc) · 846 Bytes
/
LINK.PY
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import argparse
import streamlink
parser = argparse.ArgumentParser()
parser.add_argument ('--url',type=str)
args = parser.parse_args()
while True:
try:
streams=streamlink.streams(args.url)
except IOError as e:
print(f"error")
break
except Exception as e:
print(f"error")
break
else:
try:
print(streams["best"].url)
pass
break
except IOError as e:
print("no play able stream")
break
except Exception as e:
print("no play able stream")
break
else:
print(streams["best"].url)