subtitles fix vidxgo
This commit is contained in:
@@ -92,6 +92,7 @@ async def vidxgo(link,client,streams,instance_url):
|
|||||||
decrypted_code = u.decode('utf-8')
|
decrypted_code = u.decode('utf-8')
|
||||||
match = re.search(r'currentSrc.+"(https:[^";]+)',decrypted_code)
|
match = re.search(r'currentSrc.+"(https:[^";]+)',decrypted_code)
|
||||||
submatch = re.search(r'window.__EXTERNAL_SUBS\s+=\s+(\[.*]);',decrypted_code)
|
submatch = re.search(r'window.__EXTERNAL_SUBS\s+=\s+(\[.*]);',decrypted_code)
|
||||||
|
print(submatch.group(1))
|
||||||
suburlmatch = re.search(r'window.__SUBS_ORIGIN\s+=\s*"(.*)";',decrypted_code)
|
suburlmatch = re.search(r'window.__SUBS_ORIGIN\s+=\s*"(.*)";',decrypted_code)
|
||||||
if match:
|
if match:
|
||||||
url = match.group(1).replace("\\","")
|
url = match.group(1).replace("\\","")
|
||||||
@@ -99,6 +100,8 @@ async def vidxgo(link,client,streams,instance_url):
|
|||||||
if submatch and suburlmatch:
|
if submatch and suburlmatch:
|
||||||
subtitles = json.loads(submatch.group(1))
|
subtitles = json.loads(submatch.group(1))
|
||||||
for item in subtitles:
|
for item in subtitles:
|
||||||
|
if item['forced'] == True:
|
||||||
|
item['lang'] += '-forced'
|
||||||
del item['forced']
|
del item['forced']
|
||||||
del item['file']
|
del item['file']
|
||||||
item['url'] = suburlmatch.group(1).replace('\\','') + item['url']
|
item['url'] = suburlmatch.group(1).replace('\\','') + item['url']
|
||||||
@@ -111,7 +114,7 @@ async def vidxgo(link,client,streams,instance_url):
|
|||||||
async def test_vidxgo():
|
async def test_vidxgo():
|
||||||
from curl_cffi.requests import AsyncSession
|
from curl_cffi.requests import AsyncSession
|
||||||
async with AsyncSession() as client:
|
async with AsyncSession() as client:
|
||||||
results = await vidxgo("https://v.vidxgo.co/tt1190634/1/1",client,{'streams': []},"localhost")
|
results = await vidxgo("https://v.vidxgo.co/tt0816692",client,{'streams': []},"localhost")
|
||||||
print(results)
|
print(results)
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import asyncio
|
import asyncio
|
||||||
|
|||||||
Reference in New Issue
Block a user