I am trying to remove ads from a live stream with jQuery. (I know this has been asked before, but it seems to be different in this case than in the other cases when this question has been asked some time ago.) In detail:
The iframe part of my page looks like this:
<iframe id="iframe" width="100%" height="360" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowfullscreen="yes" src="https://daddyhd.com/embed/stream-61.php"></iframe>
The PHP script (stream-61.php) loads the actual live stream (in a second iframe with id #thatframe). The problem is that the PHP script also loads a bunch of ads and scripts that continually load more ads. Plus, the second iframe can only be accessed from the server where is it stored (X-Frame-Options: SAMEORIGIN is set), so I cannot load it direct on my page.
After looking at the resulting HTML code from stream-61.php, I tried to use jQuery to .remove() all tags except the second iframe (#thatframe) with the actual live stream. It works on my computer, when I make up two iframes with my own div and script tags. But it does not work with the URL I gave above.
Any help or hint would be greatly appreciated.
Related
OK, so I have this fully working PHP script, available HERE and the results should be shown in an iframe HERE under section "Best Results". But they are not.
However they are shown if I am viewing the page signed in as admin, but I frame is invisible to normal visitors. Why is that so? How can I solve that?
EDIT:
I am using Elementor to set up the page and Custom HTML widget element with the following code:
<iframe src="/zan/fai_pilot.php?p=4385" frameborder="0" width="100%" scrolling="yes" height="440">
</iframe>
When I load your outer page, i don't see an iframe tag in the Best Results section. So that leads me to believe if you're seeing it when logged in as admin, there is something in your Elementor config regarding roles/permissions you need to change.
The answer: Don't use "Custom HTML" element from the Elementor, use "Text Editor" element instead.
this is most probably something very simple so please excuse me.
i have a variable $postVideo and within in variable is the entire embed code for a you tube link:
<iframe width="420" height="315"
src="//www.youtube.com/embed/UF-6M06lPZo"
frameborder="0" allowfullscreen></iframe>
now when i do echo $postVideo; it does not display the you tube video it shows the code on my page and in view source its printing this:
<iframe width="420"
height="315"
src="//www.youtube.com/embed/UF-6M06lPZo" frameborder="0"
allowfullscreen></iframe>
now i know i can have the user put in the youtube ID and i do it that way, but the users in my CMS may add multiple Video's from multiple sources so wanted them to just add the embed code supplied.
so i suppose the question is how do i print it without the special char so it acts like it should.
thank you in advance.
PS don't watch the video if you are offended by bad language (its just a random one from yourtube)
It looks like your CMS is automatically converting HTML entities for you to prevent XSS attacks. You just need to perform the opposite conversion using html_entity_decode(). Like this:
echo html_entity_decode($postVideo);
Though, you should keep in mind you will be outputting any arbitrary HTML the user entered onto the page. This could present a security issue if the user enters some kind of malicious script.
I want to parse a streaming website in PHP to find the streaming links and codes.
The streaming page ie index.htm looks like
<html>
<iframe> something something src= xyz.aspx?id=abc <iframe>
<\html>
When I parse the main page I can see those codes..but I need to parse the code of xyz.asx?id....
If I parse that page directly it doesnt show the streaming codes...
The main page and the iframe page somehow connected...
Is there any way to parse both at the same time..perhaps with referring or something..so the the second page thinks as if it is loaded on the stream page.
Any clue? Curl?
Since it seems like you are only searching for a couple codes, you might want to write a regex (GASP! I KNOW, REGEX + HTML = BAD, hear me out). I'd find a regex that captures all <iframe> tags. Then parse those for the src attribute, and then get the information that you need.
Edit: I don't think I understood your question entirely, you also want to embed the iframe'd page as if it were viewed in a browser?
If so, read on!
Ok, now that you have the src attribute of the <iframe>, just download the linked page (I'm a little rusty with PHP, I'm sure you can find one of the thousands of functions that would work) and str_replace() the <iframe> tag with the downloaded code
Following chunk html code works as expected:
<iframe src="http://www.amazon.com/"></iframe>
But when trying embed inner Amazon pages http://www.amazon.com/gp/product/0672329166/ref=s9_simh_gw_p14_d0_g14_i1?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=1E72BDHD1YZMPYZ2HM4Z&pf_rd_t=101&pf_rd_p=470938631&pf_rd_i=507846 nothing appears.
Firebug shows that request is well executed with a 200 OK code.
<iframe src="http://www.amazon.com/gp/product/..."></iframe>
Is there some Amazon policy involving this kind of use of their site?
They use x-frame-options to block their content from being loaded in frames.
So the latest version of Chrome and maybe Safari too doesn't let you load in iframes inless you're on the same domain for certain websites that don't want to be iframed like google.com.
<iframe src="http://www.google.com" style="width:600px;height:500px;" frameborder="0"></iframe>
The Error I get in Chrome is..
Refused to display document because display forbidden by X-Frame-Options.
Is there a workaround to avoid this error and display the iframe.
From what I read the x-frame stuff is to prevent click jacking via iframe, but I'm not trying to do that I just want to load in the site the way the iframe I thought was supposed to perform.
Is there away around this using PHP?
No, there is no way to bypass this restriction.