VideoHelp Forum




+ Reply to Thread
Results 1 to 23 of 23
  1. Hello,

    Video url: https://coivl.net/trangchu/v/zneaif
    I have been getting "Error fetching the URL: 403 Client Error: Forbidden for url: https://coivl.net/trangchu/v/zneaii" every time I try to send a request. I've tried copying header and cookies and still doesn't work. I can access it via the browser and can play the video.

    Any idea what needs to be passed?

    Thanks
    Quote Quote  
  2. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    No idea why it doesn't work directly, but one way is to save the m3u8 content to a local file and use N_m3u8DL-RE on it.
    https://www.swisstransfer.com/d/b7fb43a2-ec42-4274-85ca-3112e149aac9
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  3. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    No idea why it doesn't work directly, but one way is to save the m3u8 content to a local file and use N_m3u8DL-RE on it.
    https://www.swisstransfer.com/d/b7fb43a2-ec42-4274-85ca-3112e149aac9
    Thanks for the reply. I am able to download it one by one but while attempting to automate it, it keeps giving me the 403 error.
    Quote Quote  
  4. Member
    Join Date
    Mar 2024
    Location
    United Kingdom
    Search PM
    What client are you attempting to use? PowerShell? Python request? Something else?
    Would be very useful to see your command/code.
    Quote Quote  
  5. curl -A "xxxx" https://coivl.net/trangchu/v/zneaif
    <!DOCTYPE html>
    <html lang="vi" prefix="og: http://ogp.me/ns#">
    <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="theme-color" content="#234556">
    <meta name="msapplication-navbutton-color" content="#234556">
    <meta name="apple-mobile-web-app-status-bar-style" content="#234556">
    ...
    Last edited by LZAA; 22nd Nov 2024 at 14:58.
    Quote Quote  
  6. Originally Posted by SaintyUK View Post
    What client are you attempting to use? PowerShell? Python request? Something else?
    Would be very useful to see your command/code.
    Apologies for the slow response, got real busy yesterday night. To answer, it's Python and very simple quests:

    Code:
    def get_hrefs_and_title(url):
        # headers
        headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
            'Accept': '*/*',
            'Accept-Language': 'en-US,en;q=0.9',
            'Connection': 'keep-alive',
            'referer': 'https://coivl.net/'
        }
        
        try:
            response = requests.get(url, headers=headers, cookies=cookies)
            response.raise_for_status()
    
            soup = BeautifulSoup(response.content, 'html.parser')
    Quote Quote  
  7. Member
    Join Date
    Mar 2024
    Location
    United Kingdom
    Search PM
    Try giving httpx a go instead of requests
    Quote Quote  
  8. Originally Posted by SaintyUK View Post
    Try giving httpx a go instead of requests
    Still no go:
    Code:
    def get_hrefs_and_title(url):
        # Define the cookies
        cookies = {
            ---ommitted
        }
        
        # Define the headers
        headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36',
            'Accept': '*/*',
            'Accept-Language': 'en-US,en;q=0.8',
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
            'Connection': 'keep-alive',
            'Origin': 'https://vietnoiket.com',
            'X-Requested-With': 'XMLHttpRequest'
        }
        
        try:
            with httpx.Client(http2=True) as client:
                response = httpx.get(url, headers=headers, cookies=cookies)
                response.raise_for_status()  # Raise an error if the status code is not 2xx
    Quote Quote  
  9. Originally Posted by LZAA View Post
    curl -A "xxxx" https://coivl.net/trangchu/v/zneaif
    <!DOCTYPE html>
    <html lang="vi" prefix="og: http://ogp.me/ns#">
    <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="theme-color" content="#234556">
    <meta name="msapplication-navbutton-color" content="#234556">
    <meta name="apple-mobile-web-app-status-bar-style" content="#234556">
    ...
    Interesting. The curl also worked for me, doesnt work in python.
    Quote Quote  
  10. Member
    Join Date
    Mar 2024
    Location
    United Kingdom
    Search PM
    Indeed. So does the following for me - status code 200...

    Code:
    import httpx
    
    with httpx.Client(http2=True) as client:
        response = httpx.get('https://coivl.net/trangchu/v/zneaif')
        response.raise_for_status()
        print(response.status_code)
    Something to do with your headers or cookie?
    Quote Quote  
  11. That's what I'm trying to ask for help on
    Quote Quote  
  12. Change User Agent in your Browser.

    you will find the good link to download the video for example with hlsdl.

    Image
    [Attachment 83656 - Click to enlarge]


    Code:
    hlsdl -b -c -u "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" -h "Referer:https://vietnoiket.com" -o "S2ZHakFFYi9mQVlPdy9OUndia3k5d3hrUFV0Ykl2c0dQL3loOU91N3EvQ09qUkcxWDF2M3NDOXA0KzIvK1JuN1hXNFR1d0w4ekJlVmJray9hWWxNU0syYjlocXpoeVVaMVlQbnIvNzBpSm5ueTQ4MzhmRytreGt5VTdJMlJFTGRiR1lDdW9FUDZXQzRTRDY2Ri9saVJPZkNqdWJVQjVldkpwZTJzdmIrcktyK2pISXZKVFdkcU9pV3ZVMWlycjZDVlhuWFBVdDBrVEVaaVA5QlJCbmYvRXhOSm9SOWlFdU4rZ29yZHJ3QjhRR2JTT1BWZ1RHeTBBcWlnV0JXTmt4UXJWWGZEb1FXUUFVTUNkMFN2TDhzTHdDYUROSW4yYmNKdmFXbVI3NkMrMG89.ts" "https://vietnoiket.com/m3/S2ZHakFFYi9mQVlPdy9OUndia3k5d3hrUFV0Ykl2c0dQL3loOU91N3EvQ09qUkcxWDF2M3NDOXA0KzIvK1JuN1hXNFR1d0w4ekJlVmJray9hWWxNU0syYjlocXpoeVVaMVlQbnIvNzBpSm5ueTQ4MzhmRytreGt5VTdJMlJFTGRiR1lDdW9FUDZXQzRTRDY2Ri9saVJPZkNqdWJVQjVldkpwZTJzdmIrcktyK2pISXZKVFdkcU9pV3ZVMWlycjZDVlhuWFBVdDBrVEVaaVA5QlJCbmYvRXhOSm9SOWlFdU4rZ29yZHJ3QjhRR2JTT1BWZ1RHeTBBcWlnV0JXTmt4UXJWWGZEb1FXUUFVTUNkMFN2TDhzTHdDYUROSW4yYmNKdmFXbVI3NkMrMG89"


    Many browser extensions works.


    Image
    [Attachment 83658 - Click to enlarge]
    Quote Quote  
  13. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by InfinitiX2 View Post
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    No idea why it doesn't work directly, but one way is to save the m3u8 content to a local file and use N_m3u8DL-RE on it.
    https://www.swisstransfer.com/d/b7fb43a2-ec42-4274-85ca-3112e149aac9
    Thanks for the reply. I am able to download it one by one but while attempting to automate it, it keeps giving me the 403 error.
    found all the episodes links, do curl https://coivl.net/trangchu/v/zneaif
    now scroll down about half way until you see <div id="halim-list-server" class="list-eps-ajax">
    below that are all 18 episodes.
    Quote Quote  
  14. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by InfinitiX2 View Post
    That's what I'm trying to ask for help on
    Can you post the full script for what you're trying to do?
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  15. Originally Posted by InfinitiX2 View Post
    Hello,

    Video url: https://coivl.net/trangchu/v/zneaif
    I have been getting "Error fetching the URL: 403 Client Error: Forbidden for url: https://coivl.net/trangchu/v/zneaii" every time I try to send a request. I've tried copying header and cookies and still doesn't work. I can access it via the browser and can play the video.

    Any idea what needs to be passed?

    Thanks
    Unpretentious advertising
    Quote Quote  
  16. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Originally Posted by InfinitiX2 View Post
    That's what I'm trying to ask for help on
    Can you post the full script for what you're trying to do?
    Code:
    def get_hrefs_and_title(url, logging):
        headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
        }
        
        try:
            response = requests.get(url, headers=headers)
            response.raise_for_status()
            
            soup = BeautifulSoup(response.content, 'html.parser')
            
            # Select the first <ul> element inside the specified div
            first_ul = soup.select_one('.halim-list-eps')
            
            # Extract hrefs from the first <ul> element
            if first_ul:
                halim_episodes = first_ul.select('li.halim-episode a')
                hrefs = [a.get('href') for a in halim_episodes if a.get('href')]
    
            # Extract title
            title_element = soup.select_one('.entry-title')
            title = title_element.get_text(strip=True) if title_element else 'default-title'
            
            # Remove "- Tap.*" from title
            title = re.sub(r'-\s*Tap.*$', '', title)
            
            # Remove accents and format title for filename
            title = unidecode(title)  # Remove accents
            filename = re.sub(r'\s+', '-', title.lower())
            filename = re.sub(r'[^\w\-]', '', filename)  # Remove any non-alphanumeric characters except hyphens
            
            # Remove trailing hyphen if it exists
            filename = re.sub(r'-$', '', filename)
            
            # Format title for show_title (title case)
            show_title = title.title().strip()  # Remove any extra spaces
            return hrefs, filename, show_title
        
        except requests.exceptions.RequestException as e:
            print(f"Error fetching the URL: {e}")
            return [], 'default-title', 'Default Title'
    The code itself is quite long but If I can get the request to work then I should be able to do the rest. Here is a simple function I used to grab the episodes url and the title of the show to act on later. I apologize for slow response but I am still following this thread
    Quote Quote  
  17. Originally Posted by october262 View Post
    Originally Posted by InfinitiX2 View Post
    Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    No idea why it doesn't work directly, but one way is to save the m3u8 content to a local file and use N_m3u8DL-RE on it.
    https://www.swisstransfer.com/d/b7fb43a2-ec42-4274-85ca-3112e149aac9
    Thanks for the reply. I am able to download it one by one but while attempting to automate it, it keeps giving me the 403 error.
    found all the episodes links, do curl https://coivl.net/trangchu/v/zneaif
    now scroll down about half way until you see <div id="halim-list-server" class="list-eps-ajax">
    below that are all 18 episodes.
    I have no problem finding it manually. It's scripting that's failing me.
    Quote Quote  
  18. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by InfinitiX2 View Post
    The code itself is quite long but If I can get the request to work then I should be able to do the rest.
    Make a simple separate script where you include the necessary minimal code that gives you problems with the 403. That includes the minimum necessary imports and also a small main code that calls that method for a specific URL. I'm asking cause I'm running this code you gave with no problems and I dunno if I put the wrong URL.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  19. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Originally Posted by InfinitiX2 View Post
    The code itself is quite long but If I can get the request to work then I should be able to do the rest.
    Make a simple separate script where you include the necessary minimal code that gives you problems with the 403. That includes the minimum necessary imports and also a small main code that calls that method for a specific URL. I'm asking cause I'm running this code you gave with no problems and I dunno if I put the wrong URL.
    You didn't get a 403 Forbidden? Here is a simple one:
    Code:
    import argparse
    import requests
    
    def send_request(url):
        headers = {
            'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
            'Accept': '*/*',
            'Accept-Language': 'en-US,en;q=0.9',
            'Connection': 'keep-alive',
            'referer': 'https://vietnoiket.com'
        }
    
        try:
            response = requests.get(url, headers=headers)
            response.raise_for_status()  # Raises an error for bad status codes
            print(f"Response from {url}:")
            print(response.text)
        except requests.exceptions.RequestException as e:
            print(f"Error occurred: {e}")
    
    if __name__ == "__main__":
        # Set up argument parser
        parser = argparse.ArgumentParser(description="Send API request and print response")
        parser.add_argument("-u", "--url", type=str, required=True, help="URL to send the request to")
        
        # Parse arguments
        args = parser.parse_args()
    
        # Send API request
        send_request(args.url)
    send_api.py -u "https://coivl.net/trangchu/v/zneaif"
    Error occurred: 403 Client Error: Forbidden for url: https://coivl.net/trangchu/v/zneaif
    Quote Quote  
  20. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by InfinitiX2 View Post
    You didn't get a 403 Forbidden? Here is a simple one:
    Nope. Works fine for me. It just prints the html page.Are you using a proxy on your browser to access the page? Cause if you do, you need to add in code proxy or simply use a VPN.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  21. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Originally Posted by InfinitiX2 View Post
    You didn't get a 403 Forbidden? Here is a simple one:
    Nope. Works fine for me. It just prints the html page.Are you using a proxy on your browser to access the page? Cause if you do, you need to add in code proxy or simply use a VPN.
    Thank you! It worked when I tried a with a VPN, I guess it's IP related then despite it working on my browser.
    Quote Quote  
  22. the m3u8 link of the video is in the image.
    Image
    [Attachment 83744 - Click to enlarge]
    Quote Quote  
  23. Member MartinTH's Avatar
    Join Date
    Oct 2024
    Location
    Germany
    Search PM
    Originally Posted by sesamap159 View Post
    the m3u8 link of the video is in the image.
    Image
    [Attachment 83744 - Click to enlarge]
    How do you get this Link/URL ?

    No index.php is found in my Firefox Browser.
    Quote Quote  



Similar Threads

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