playlist = """#EXTM3U
#EXTINF:-1 tvg-id="40791" tvg-logo="https://avdmono.do.am/avdlogo/Cinema.png",AVD TV
v2.catcast.tv/content/40791/index.m3u8
#EXTINF:-1 group-title="Кино",Amedia 1 HD
persik.by/stream/7504/377885/10380.m3u8
#EXTINF:-1 ,#EXTGRP:Кино,10
livetv.mylifeisgood.ml/mfolive.m3u8?media=vip_premiere
#EXTINF:-1,Кинохит HD
#EXTGRP:Кино
193.33.88.172:8080/kinohit/index.m3u8
#EXTINF:-1 tvg-id="eb3d46480e595ffbb818e5df2cc5ca3a",2x2
80.237.96.73:9090/stream/channelid/1212562923?tick..."""
x = playlist.split('\n')
result = ''
for i in x:
if i.find('#EXTINF') != -1:
result += '#EXTINF:-1, '+i.split(',')[-1]+'\n'
elif i[0] != '#':
result += i+'\n'
print(result)
#EXTINF:-1, AVD TV
v2.catcast.tv/content/40791/index.m3u8
#EXTINF:-1, Amedia 1 HD
persik.by/stream/7504/377885/10380.m3u8
#EXTINF:-1, 10
livetv.mylifeisgood.ml/mfolive.m3u8?media=vip_premiere
#EXTINF:-1, Кинохит HD
193.33.88.172:8080/kinohit/index.m3u8
#EXTINF:-1, 2x2
80.237.96.73:9090/stream/channelid/1212562923?tick...
html = """<td>
OC[<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e9aaa9a1">[email protected]</a>](OC(CCCCCCCCCCCCC)=O)COC(CCCCCCCCCCCCC)=O
</td>"""
from cgitb import reset
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, 'html.parser')
def decode(g):
r = int(g[:2],16)
email = ''.join([chr(int(g[i:i+2], 16) ^ r) for i in range(2, len(g), 2)])
return email
start = str(soup).find('data-cfemail="')+len('data-cfemail="')
stop = str(soup)[start:].find('"')
x = str(soup)[start:start+stop]
result = str(soup.text).replace('[email\xa0protected]', decode(x))
print(result)
#OC[C@H](OC(CCCCCCCCCCCCC)=O)COC(CCCCCCCCCCCCC)=O