-1

Below HTML is generated by a bunch of JS that i cannot change.

<div class="classname1">
    <video disableremoteplayback="" preload="none" playsinline="" style="visibility: hidden;">
        <source
            type="video/mp4"
            src="https://simple.url.link"
        />
    </video>
    <div class="classname2"><canvas width="964" height="542"></canvas></div>
</div>

Below HTML is already in the document somewhere

<div id="bhadoo-dl" class="classname3">
</div>

Work needs to be done: I want to get https://simple.url.link which is dynamic from src

and then display it in div with id="bhadoo-dl" with content <a href="">DL</a> tag using JS. (i know how to print this in div. i am unable to fetch the src data.

working on this site. (18+ content, proceed with caution, URL is temporary) https://exss.pornproxy.workers.dev/view_video.php?viewkey=ph5f36910706a6a

<div class="mhp1138_videoWrapper"><video disableremoteplayback="" preload="none" playsinline="" style="visibility: hidden;"><source type="video/mp4" src="videourl"></video><div class="mhp1138_screenshot"><canvas width="660" height="371"></canvas></div></div>
<a id="bhadoo-dl" href="">Download</a>

loading the js code from https://workspace.parveenbhadoo.com/s.js

https://imgur.com/C6yDwUl https://imgur.com/Sedu22f

I've tried several things.

4
  • $(".classname1 > video > source").attr("src") seems to work ok jsfiddle.net/wrxh42ta - what did you try?
    – freedomn-m
    Sep 24, 2020 at 11:25
  • what have you tried? We expect that you'll do some research and make an attempt before posting a question here. Sep 24, 2020 at 11:28
  • is it inside an <iframe> ? Sep 24, 2020 at 11:30
  • updated post with more data. Sep 24, 2020 at 13:12

1 Answer 1

-1

try this

const src = $(".classname1 > video").find('source').attr("src")
$('#bhadoo-dl').attr('href',src)
3
  • it will work directly, but not in this case. check the updated post. Sep 24, 2020 at 13:12
  • please clarify your updated post, i dont understand, or you can explain it here
    – Jerson
    Sep 24, 2020 at 13:15
  • view source of given site. and the button Download. I am fetching it from the src and displaying the link on download button from video url. Sep 24, 2020 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.