VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. Hi Forum, I need python script to get m3u8-link from thise site: https://www.bgonair.bg/tvonline

    Thanks
    Quote Quote  
  2. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Code:
    import re
    
    import requests
    
    SITE_URL = "https://www.bgonair.bg/tvonline"
    pattern = r'src="//([^/]+)/live/([^"]+)"'
    matched_url = re.findall(pattern, requests.get(SITE_URL).text)[0]
    live_url = f"https://{matched_url[0]}/live/{matched_url[1]}"
    
    pattern = r'src="//.*?/playlist\.m3u8(?:\?[^"]+)?"'
    matched_url = re.search(pattern, requests.get(live_url).text).group(0)
    m3u8_url = "https:/" + matched_url[6:-1]
    print("M3U8:", m3u8_url)
    Output:
    Code:
    M3U8: https://lb-hls.cdn.bg/2006/fls/bonair.stream/playlist.m3u8?at=d4b2a92264e3297adc2bf78f720af6ef
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 12th Feb 2024 at 06:17. Reason: Changed the detection for live_url to be more general considering that only /live/ is fixed
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*]
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!