How to get m3u8 link from live streaming link - php

I want to get the m3u8 link which loaded after playing video. From the website https://www.firstonetv.eu. It's unavailable in HTML source code. Now I can see it on network tab in Chrome. Here is the image:
Network tab snap
But I want to get it through PHP.Also, a javascirpt solution is appreciated. How could I get the m3u8 link?

Every site is different. You would have to reverse engineer their site to figure out how it's getting the URL to the HLS playlist.
Alternatively, a generic solution could be implemented by writing a browser extension to look for application/x-mpegURL in the content type headers in HTTP responses... and when you find one, log it or open it elsewhere. Keep in mind that the video you get could be anything... ads and such.
What you should do instead though is contact the site and ask for access to their API or a better proper way to do this. You do have their permission, right?

Related

Get source code of SoundCloud page with PHP

I'm trying to get the HTML source code of a SoundCloud link through PHP, but the https protocol makes it nearly impossible with file_get_contents(). I went with curl, but even though it does connect to SoundCloud, it returns a "track not found" error instead of the actual track page, so I suppose there's some additional protection.
Any help getting over this? I know there must be a way, since tools like http://source.domania.net/ have no trouble when I input an URL like https://soundcloud.com/mild-network/wcbf, for example.
Alternatively, is there any "page source viewer" online that can access https and has an API I could work with?
Hope this isn't too specific.

Facebook's Open Graph scraper slow to fetch og:image?

Context
I'm running a site over https where new content (each entry has its own page) can be created and shared by users.
Each page has an image, and this image url is present in the og:image meta tag at the top of the page.
Problem
Facebook seems slow to pick up on the og:image. When the page is first created and a user attempts to share the URL, for the first ~1-3 tries, the og:image is not scraped / rendered by Facebook (the title and description are). Afterwards, the image is clearly visible in the share dialog.
A similar issue also occurs when using Facebook's OG URL debug tool. The first time I pop in the URL, it shows no image. If I choose to fetch the page from the source again, it shows the image.
Additional Notes
At first, I thought it might have been site code initially not showing the image, but I sent a curl request and spoofed one of Facebook's user agent strings (this is important to accessing the page) and the resulting HTML contains the og:image tag with the correct image URL. I also know it's not anything to do with accessing the page, or the og:title and og:description data would not be showing (but it is).
My only lead is that it could be an SSL or HTTPS issue. I recently set up the SSL certificate but I'm not sure why that would cause a delay over it not working at all.
For the sake of clarity, the site runs on WordPress on top of a standard LAMP stack.
The issue is apparently a fairly common one. The solution was to, on content creation, send a request to facebook's scraper tool with the content's URL. The scraper will pick up and process the image, allowing the first share to already have that image cached by Facebook.
Yes I've noticed this as well. It takes a long time for Facebook to cache the og:image. Tumblr does it automatically. The only reason why I could imagine why Facebook does this other than poor programming is because perhaps they have a review team scrolling through the thumbnails to block nudity and other crude images. As mentioned above, clicking the facebook share url manually upon creation will prompt them to cache it, hopefully before others click too.
I have been analyzing this issue one year ago. I had the same problem. The og:image meta tag has been only updated after several rescrape attempts.
This re-scraping can be easily triggered on this page https://developers.facebook.com/tools/debug/
According to my old analysis, the root cause of this behavior is that the FB scraper seems to have a very very short timeout. If the content page does not reply to the scraper request very quickly, FB doesn't take this reply into account. Even if the content page serves the correct meta data and a valid HTTP/200 reply, FB ignores it because "too late is too late".
I didn't find any solution for this besides "prescraping" as has been already described by Sean.
In My Case I had a azure WebApp with HTTPS setup without SSL Certificate installed. As It was in Production stage, I tested by reverting back to HTTP. All "og" tags were detected.
So, If your SSL is not properly configured and/or Facebook gives CURL SSL Error, looking into SSL might help.

Change url referrer to look like comming from facebook using a redirect url

I made a pdf ebook where I embeded a link to a youtube video I uploaded.
on youtube stats, it shows that my traffic source is unknown.
I know this is hurting the seo of my video. This is why I am trying to enhance my youtube seo by making the visitors who come from my pdf looks like comming from facebook.
I know this is called faking the referral but I don't know if this can be done through this way:
1 _ user click on the link embeded in the PDF.
2 _ the user get redirected to "myscript.com".
3 _ "myscript.com" will redirect the user to youtube.
4 _ youtube stats show traffic comming from facebook.
please, if you know anything about this, help me.
This isn't possible. You can fake the referrer in your own browser, but you can't force someone else's browser to fake it.
What your solution will do is show the referrer as being your own website. That may still be better than it seemingly coming from nowhere. But, on the other hand, it may not. I'm no expert on the way that Youtube SEO works. I suspect, though, that anything which attempts to deliberately manipulate it is likely to hurt rather than help you. Let your content be its own best advert.
If you're determined to go down this route, though, an alternative solution would be to set up a Facebook page and embed the video in that. Then make the Facebook page the destination of the link in the PDF. That way, the referrer for the video really will be Facebook.
Faking a URL isn't going to enhance your SEO. If you want to track traffic from that ebook, use UTM tagging in that embedded URL.
I'm not sure if this will be reflected in your YouTube stats, but should be easy to track in Google Analytics.

Facebook Open Graph Movie Doesn't Play in Feed

I can't really figure out what I doing wrong here. My open graph code, I think it's correct, but it won't play the video inline like I expect it to:
view-source:http://recordmob.com/dev/?{%22track_id%22:%2284%22}
I pop it into the linter on facebook and it comes back all aces?
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Frecordmob.com%2Fs%2FS
Why the heck doesn't this play inline like it should? I'm pulling my hair hour.
The video source URL is HTTP only - are you browsing Facebook with HTTPS enabled? Facebook won't embed content that would cause mixed content - either include a secure URL for the video, or disable HTTPS on your facebook account - i recommend the former

Flash HTTP requests URL containing RTMPE URL. How do I trick it to get a local copy or a copy with my content?

A web channel streaming service streams to a certain IP range, it only checks the IP in example.com/cmd.php?id=xxx (channel number) and outputs an rtmpe stream URL, nothing else.
How do I trick it to get my local URL instead of the one on their server? I have considered squid proxy, but is there some way to do it with a firefox plugin or greasemonkey script?
It's hard to explain in shot text, so feel free to ask. Sorry if it made no sense.
Also, I'm new to stackoverflow, please bear with me, and feel free to tell me if my question is not allowed here.
Thank you.
Edit:
I will try to specify:
It's a streaming service from an ISP and cable provider.
They stream for free to people on their IP's. On their webtv page, which is called webtv.example.com, there is a flash player. If you are not on an IP from their ISP, you can't stream anything but the test channel.
When you try to change channel via. javescript:videoplayer_changechannel(xxx) it makes this HTTP request:
GET https://removed.com/cmd.php?sid=XXX&cmd=get%5Fserver [HTTP/1.1 200 OK 88ms]
If you are on one of their IP's you will get an RTMP URL, like this:
servers=rtmpe://removed*.dk/live/;&profile=6&filename=*removed*.stream
This is what the flash player requests, and if it get's this response it load the channel requested. There is no HTML on the php page, just the URL. Note that the rtmp URL is static.
If you are not on one of their IP's it will return a random sentence (something stupid, the programmers having fun).
I wan't to trick the flash player into getting the right value, even though it's not on one of the ISP's IP's.
I would like to know if this is possible with a browser plugin or script.
You could download the Web Developer Toolbar for FireFox if you wanted. This would allow you to edit the HTML (provided the page doesn't use frames). Though this would only be useful if the URL is actually stored on the page.
If the URL is stored in JavaScript then you could just type in javascript:varName = 'myurl'; in your URL bar and that'll update the JavaScript for you.
If it's a flash based streaming service then your easiest method is the proxy that you've got running at the moment.
I'm sorry if this answer isn't good for you - but it's hard to provide an answer without studying the site your questioning about.

Categories