forked from MarseyWorld/MarseyWorld
allow pcm /live to enter channel link
parent
8a85c2413c
commit
5a97a6f6e6
|
@ -544,10 +544,12 @@ if SITE == 'pcmemes.net':
|
||||||
if v.id not in (AEVANN_ID, KIPPY_ID, 1550):
|
if v.id not in (AEVANN_ID, KIPPY_ID, 1550):
|
||||||
return {"error": 'Only Kippy can add channels!'}, 403
|
return {"error": 'Only Kippy can add channels!'}, 403
|
||||||
|
|
||||||
id = request.values.get('id').strip()
|
link = request.values.get('link').strip()
|
||||||
|
|
||||||
if not id.startswith('UC'):
|
if 'youtube.com/channel/' in link:
|
||||||
text = requests.get(f'https://www.youtube.com/c/{id}', cookies={'CONSENT': 'YES+1'}, timeout=5, proxies=proxies).text
|
id = link.split('youtube.com/channel/')[1].rstrip('/')
|
||||||
|
else:
|
||||||
|
text = requests.get(link, cookies={'CONSENT': 'YES+1'}, timeout=5, proxies=proxies).text
|
||||||
try: id = id_regex.search(text).group(1)
|
try: id = id_regex.search(text).group(1)
|
||||||
except: return {"error": "Invalid ID"}
|
except: return {"error": "Invalid ID"}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
{% if v and v.admin_level > 1 %}
|
{% if v and v.admin_level > 1 %}
|
||||||
<form action="/live/add" method="post">
|
<form action="/live/add" method="post">
|
||||||
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
<input class="form-control" style="display:inline;width:350px" autocomplete="off" type="text" name="id" class="form-control" placeholder="Enter channel id or name.." maxlength="24" required>
|
<input class="form-control" style="display:inline;width:350px" autocomplete="off" type="text" name="link" class="form-control" placeholder="Enter channel link.." required>
|
||||||
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" onclick="disable(this)" value="Add Youtube Channel" style="margin-bottom:5px">
|
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" onclick="disable(this)" value="Add Youtube Channel" style="margin-bottom:5px">
|
||||||
</form>
|
</form>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue