Hi,
I have a youtube video embedded in a node page and I wanted a module to check whether or not these videos had been deleted from youtube so that I could take action i.e. delete the node, or find another video with the same content.
The URL in the iframe on my node page is like this though (using media module and media_youtube):
<div class="content">
<div class="media-youtube-video media-youtube-1">
<iframe class="media-youtube-player" width="610" height="343" src="//www.youtube.com/embed/wdVt-H6jzyI?wmode=opaque&modestbranding=1&rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
</div>
</div>
Clicking on that above link in my source code takes me to another source code page which contains:
<link rel="canonical" href="/watch?v=wdVt-H6jzyI">
That is the URL that needs checking but it does not appear in the source code of my node page. The video resides here (well it did before I deleted it):
http://www.youtube.com/watch?v=wdVt-H6jzyI
I have set linkchecker to scan the nodes in which these videos appear (node type video_post), and run cron, change the error reporting codes back and forth, ran cron again, cleared data, ran cron. I have tried a bunch of different things but every time in my reports it says no broken links.
In order to test, I uploaded a test video to youtube, linked to it from my test site, then deleted the video. Ever since I have been trying to get this broken link to show up in my report. My site cannot go ahead if I don't have an automated process of checking for broken youtube video links as it will be a total disaster!
Any thoughts are very much appreciated. Thanks.
Sam.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | linkchecker_1811908+Allow+extracting+protocol+relative+urls.patch | 874 bytes | hass |
| #6 | linkchecker_1811908+Allow+extracting+protocol+relative+urls.patch | 974 bytes | hass |
Comments
Comment #1
hass commentedCan you share a public link with the video so I can look into the source code?
Comment #2
hass commentedAside, I have never tested links with protocol relative url's. This URLs are not extracted yet. This is the reason why your link is not checked. Can you change this to "http://" just as a quick solution?
Feel free to share a patch for this feature.
Comment #3
hass commentedIt should be fairly easy to solve, but it needs to wait for #1441574: Port D6 access bypass bugfixes to D7.
In function
_linkchecker_extract_links()we just need to add another condition above (?) line 1453 to detect urls starting with//and fix them withhttp://and we may be done with a 3 liner.Comment #4
samwillc commentedHi,
Thanks for the response. I'm quite surprised no-one else has requested a feature like this for embedded videos, after all, deleted ones which you didn't know were deleted would put a real spanner in the works. I guess a lot of people would just upload videos to their own account, then link to them. After all, you should know if you deleted your own videos! This isn't an option for me though, I was planning on chucking in loads of random videos.
Unfortunately I can't share a link as this is on a local site, the html I gave above is the most I can share. I don't understand how the video is embedded. It's in an iframe but the url in that iframe goes somewhere else, where the actual url to the video is i.e. the '/watch?v=wdVt-H6jzyI' bit.
I have never seen a link start like this 'src="//www.youtube.com...'.
Could linkchecker follow the link '//www' (is not broken) and then check the '/watch?v=wdVt-H6jzyI' (is broken) afterwards?
I wish I could help more but can't fully see what the problem is as I don't understand how linkchecker works. Even if http was added at the front of the URL, you would end up with this:
Which links to a fullscreen version of the video. Would that be enough to check whether the video has been deleted or not?
Doesn't it need to be checking:
Another thought. Could linkchecker extract the ID 'wdVt-H6jzyI' and then construct a URL 'http://www.youtube.com/watch?v=ID' and then check that?
Thanks for the quick response and sorry for not being much extra help!
Sam.
*edit* 14/10/12 10:38am --------------------------
https://developers.google.com/youtube/iframe_api_reference
I noticed the onError bit:
"100 – The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private."
Is this something that can be checked?
Sam.
Comment #5
jelo commentedWould it help you to use the emfield module with the provider module for YouTube? Then the link to the video (http://www.youtube.com/watch?v=wdVt-H6jzyI) is stored in a CCK field of type "link" and linkchecker should be able to check it. The emfield module will then take care of the embedding on the page and puts the URL itself into the player code. There was a longer discussion in YouTube and Vimeo provider modules about the relative protocol URLS and how to handle it best in these modules (http://drupal.org/node/1368818, http://drupal.org/node/1768362). It seems to be a larger issue in Drupal and some issues indicated that D8 will make extensive use of protocol relative URLs (http://drupal.org/node/1377840). I guess if linkchecker is able to handle protocol relative URLs, it won't be a problem...
Comment #6
hass commentedPatch attached, requires #1441574: Port D6 access bypass bugfixes to D7
Comment #8
hass commentedThis one fixes the issue.
Comment #10
hass commentedComment #11
samwillc commentedHi,
I didn't want to use emfield as I think it's already nightmarish enough in Drupal just trying to embed some media without chucking further modules into the mix!
Without a way of checking youtube links though, a media site using embedded video is a total non-starter in Drupal.
I wish I could help with the php but all I can do is wait, and test.
Sam.
Comment #12
hass commentedThis issue may be solved very soon, but what CMS is available that have a module like linkchecker? It looks unique to me... :-)
Comment #13
samwillc commentedThat's not the point I was making ;)
It is essential for an automated way of checking broken external links (which includes youtube/vimeo embeds). This module is superb, don't get me wrong but it's not as much use to me as the majority of my links are external on this site.
The site is very experimental as I am trying to find the easiest way to present videos in D7. So far, it was going ok until a browser plus update totally ruined all my links/thumbnails, the lot! Needless to say, I wont be using that again, just media 2 on it's own... and linkchecker perhaps? :)
Sam.
Comment #14
hass commentedhttp://drupalcode.org/project/linkchecker.git/commit/f637923
Comment #15.0
(not verified) commentedFurther clarification