Unable to access link except by clicking button on website

Viewed 25

So there is a link from a website I have been trying to access using python requests library. Normally on clicking the button, it redirects to another website but copying and pasting the referrer link either in the browser directly or using requests.get() only returns the referrer page. The link to the referrer page is: "https://www.thenetnaija.net/videos/kdrama/16426-alchemy-of-souls/season-1/episode-7"

Here's the html with the button

<a
              href="https://www.thenetnaija.net/videos/kdrama/16426-alchemy-of-souls/season-1/episode-7/download"
              class="btn"
              type="submit"
              title="Download Video"
            >
                <i class="fas fa-download"></i> Download <i class="fas fa-file-video"></i>
                <span class="small-text">(Video)</span>
</a>

if I try to copy and paste the link ("https://www.thenetnaija.net/videos/kdrama/16426-alchemy-of-souls/season-1/episode-7/download") directly in browser, it redirects to this link ("https://www.thenetnaija.net/videos/kdrama/16426-alchemy-of-souls/season-1/episode-7") instead of this ("https://www.sabishare.com/file/mHxiMiZHW15-alchemy-of-souls-s01e07-netnaija-com-mp4")

so the only way to get to this url ("https://www.sabishare.com/file/mHxiMiZHW15-alchemy-of-souls-s01e07-netnaija-com-mp4") is by clicking the button in this page ("https://www.thenetnaija.net/videos/kdrama/16426-alchemy-of-souls/season-1/episode-7").

Also, this is my python code:

def gen_link(url):
    headers = {
        'Authorization': 'Bearer {token}', 
        'Content-Type':'application/json', 
        }
    print(dUrl)
    resp = requests.get(dUrl, headers=headers, allow_redirects=True)
    print(resp.url)

how is it that the destination url is somewhat blocked and can only be accessed if i click the button from the referrer webpage?

0 Answers
Related