1.1.0 Updated! Added Live TV!
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
from bs4 import BeautifulSoup
|
||||
import json
|
||||
from Src.Utilities.dictionaries import okru
|
||||
|
||||
|
||||
|
||||
async def okru_get_url(id,client):
|
||||
embed_link = okru[id]
|
||||
print(embed_link)
|
||||
response = await client.get(embed_link, allow_redirects=True, impersonate = "chrome120")
|
||||
soup = BeautifulSoup(response.text, 'lxml')
|
||||
div = soup.find('div', {'data-module': 'OKVideo'})
|
||||
data_options = div.get('data-options')
|
||||
data = json.loads(data_options)
|
||||
metadata = json.loads(data['flashvars']['metadata'])
|
||||
m3u8_link = metadata['hlsMasterPlaylistUrl']
|
||||
print("MammaMia: Found results for Okru")
|
||||
return m3u8_link
|
||||
Reference in New Issue
Block a user