Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

download.py中的result = re.search("https://.+m3u8", dr.page_source)获取m3u8地址似乎有问题 #127

Open
addwater1 opened this issue Sep 13, 2023 · 1 comment

Comments

@kptung
Copy link

kptung commented Sep 22, 2023

可以用python對字串進行後處理,例如

使用字串分割提取src後面的內容

start_index = m3u8url .find('src="')
if start_index != -1:
    start_index += len('src="')
    end_index = m3u8url .find('m3u8', start_index)
    if end_index != -1:
        src_url = m3u8url [start_index:end_index]+"m3u8"
        print(src_url)
    else:
        print("未找到src屬性的結束引號")
else:
    print("未找到src屬性")
m3u8url = src_url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants