YouTube embed url with playlist parameter doesn't work except on the first load - youtube-iframe-api

I've encountered an issue with YouTube embed urls that have a large number of video ids in the playlist parameter. For example: https://www.youtube.com/embed/VIDEOID1?playlist=VIDEOID2,VIDEOID3,...,VIDEOID20
On the first load, it works, but if I refresh, it says "This video is unavailable". I then tried in other browsers, and on a different computer, and got the same error right away. I waited a few days and tried again, and it worked one time, and then went back to the error. Changing the videos in the list also has the same effect: for each unique list, it works once and then errors out. This only happens with a larger number of videos.
Digging into the html responses and doing a comparison between the times it works and the times it doesn't, I found that there is a PLAYER_VARS object in the JS on the page, and it contains a "list" property when it works, but that property is missing for the times the error occurs. I also found that the value of the "list" property can be used as a query string parameter to the embed url ("list" query string parameter), and that works consistently.
Is this a known bug and/or is there a way to work around it? The evidence seems to suggest some kind of server-side caching problem on the YouTube side.

The cause of this problem turned out to be the inclusion of a couple of videos marked private in the playlist.

Related

Facebook does not display my post image and can't fix it via facebook debugger

Every times I post any web page from my website on facebook, I expect its main image to be displayed for better communication rank and this is ok in the preview page, when I'm pasting the post url immediatly as you can realize it from the attached image. but when it's saved, the images goes off as you can see from another attached image.
After searching a while on google in order to know what is wrong with my web page, I realize that the page can be debugged via this tool provided by facebook, but even when I followed all the recommended step, I still face the same issue. (anyone can try it and see the result).
When continuing my research I find that there would be some issues with og:image as facebook debugger shows in the following message:
Inferred Property
The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags. but the truth is that I really don't know what to do exactly to fix this.
Any help will be appreciated.

Youtube iframe looped video not working on first load

I'm embedding a video on my website from YouTube and I want it to loop. To do that I have to use the loop and playlist parameters. I do that and it generates a link like this: https://www.youtube.com/embed/MegurLP8PxI?playlist=MegurLP8PxI&autoplay=1&controls=0&rel=0&enablejsapi=1&start=312&loop=1&widgetid=55. So the loop parameter is set to 1 and the playlist is set to the video id MegurLP8PxI.
The issue is that when I initially load the video it shows the This video is unavailable error. Refreshing the page fixes that but that's not ideal. What makes it hard to understand what's wrong is that this only happens sometimes, seemingly at random. Happens with other videos too.
Another fix that I found is removing the playlist parameter from the url. However than the video will not loop, which I really need it to. Any help would be really appreciated.

broken "updateUrl" when sharing on a company page

Whenever I share on a company page, the "updateUrl" that is returned leads to a 404 page.
https://www.linkedin.com/company/{company_id}/comments?topic={topic_id}&type=U&scope={scope_id}&stype=C&a=yzVb
This happens every single time. Before this started happening, there would be a "small" delay between the post and the URL "becoming" valid, now it just stays invalid forever.
It's just unacceptable, first you no longer allow OAuth 1 tokens when posting to company pages without any prior notice and I still haven't seen any "updates" in the documentation or elsewhere regarding this matter, AND NOW you also break the "URLs", yet again without any official announcements.
Since there is no "Linkedin Status Page" we don't even know if this is a "known" issue that is being actively worked on, or if it has been reported before at all.
Just to be perfectly clear, this is not a "code" issue on my end, the same thing happens when I "create" the share using the "REST Console" over https://apigee.com/console/linkedin .
Since it looks like this is not going to get fixed anytime soon, even though I've been told that they are aware of the issue, in the meantime I ended up "constructing" the "permalink" to the "update" myself by using the "updateKey":
id = "UPDATE-c5323310-6328147480441683969"
url = "https://www.linkedin.com/feed/update/urn:li:activity:#{id.split('-').last}/"
It's not ideal and very error prone, since they could change the permalinks again, but at least it works for now as a "temporary" workaround.

Getting the download url of a video from a site

I'm trying to build a web scraper which downloads videos from "fmovies.se".
I was not able to fully extract the video url given the webpage.
The webpage I'm considering is "https://fmovies.se/film/la-cage-doree.5283j".
Two queries are required to retrieve the video url.
The initial one is 'https://fmovies.se/ajax/episode/info?ts=1483027200&=2399&id=9076jn&update=0'.
The query is composed of "ts", "_", "id" and "update" elements. Everything except "_" part was mentioned in html code of the webpage.
I couldn't get from where "_2399" part was coming.
Can anyone help me with this ?
Even if you figure out how those parameters are computed, they can change their algorithm at any moment, which this site specifically has done in the past, see this thread.
You need a long lasting solution — a headless browser.
You can use a headless browser to simulate user interactions programmatically and intercept the XHR request that you are looking for (e.g. https://fmovies.se/ajax/episode/info?ts=1483027200&=2399&id=9076jn&update=0).
One of the best headless browsers out there is Puppeteer and there's a lot of information on how to use it.

Like button incorrectly reports zero likes for some pages

On a fairly simple website, all of the user-facing pages have the Facebook like button on them, using the iframe embed method. Thing is, on some of the pages the like count is always reported as 0; on other pages, the like count is reported correctly. This is particularly odd, given that the working and non-working pages share the same page template, and therefore have the same code.
So far, I have:
Used the FB Lint tool to confirm that the non-working pages validate correctly with no errors
Confirmed that the og:url tag is pointing to the correct URL for the page
Confirmed that the Like button actually works (liked content shows up on FB)
Confirmed (via the query API) that FB actually is counting the likes, and that the likes are >0
Confirmed that the issue seems to be page-specific; in other words, the like button always fails on the same pages, and always works on the same pages
Anyone know what might be causing this?

Resources