forked from rDrama/rDrama
fsdfds
parent
caeeb0ddde
commit
d0ff33ba63
|
@ -579,7 +579,8 @@ def submit_post(v):
|
||||||
elif "youtu" in domain:
|
elif "youtu" in domain:
|
||||||
yt_id = re.match(re.compile("^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|shorts\/|\&v=)([^#\&\?]*).*"), url).group(2)
|
yt_id = re.match(re.compile("^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|shorts\/|\&v=)([^#\&\?]*).*"), url).group(2)
|
||||||
params = parse_qs(urlparse(url).query)
|
params = parse_qs(urlparse(url).query)
|
||||||
t = params.get('t', params.get('start', [0]))[0].replace('s','')
|
t = params.get('t', params.get('start', [0]))[0]
|
||||||
|
if isinstance(t, str): t = t.replace('s','')
|
||||||
if t: embed = f"https://youtube.com/embed/{yt_id}?start={t}"
|
if t: embed = f"https://youtube.com/embed/{yt_id}?start={t}"
|
||||||
else: embed = f"https://youtube.com/embed/{yt_id}"
|
else: embed = f"https://youtube.com/embed/{yt_id}"
|
||||||
elif app.config['SERVER_NAME'] in domain and "/post/" in url and "context" not in url:
|
elif app.config['SERVER_NAME'] in domain and "/post/" in url and "context" not in url:
|
||||||
|
|
Loading…
Reference in New Issue