Media Url Scanner

SteveX
SteveX
@ultrajam
9 years ago
2,584 posts
I have the module enabled, in jrCore "Convert Media URLs (UrlScan)" is checked for the quota, and the youtube module is enabled for the quota (but no youtubes have been created). And have emptied caches.

If I put a youtube url into the forum or blog post the url is not converted, although smilies are.

Is there a step that I am missing? Does the module only work for youtubes that have been uploaded to the site?

Thanks!


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 08/31/16 11:36:27PM
douglas
@douglas
9 years ago
2,803 posts
Hey Steve,

Have you added youtube.com to the iframe modules allowed URL's?

I'm not seeing an issue on my dev site.


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
SteveX
SteveX
@ultrajam
9 years ago
2,584 posts
Hi Douglas :) hows things with you?

Yes, both youtube.com and youtu.be are allowed in iFrame Control.

I can see it working on the forum here (searched for a post where Brian posted a youtube) so I wondered if I had missed a step somewhere along the way.

If I haven't it's possibly a problem with a listener in one of my custom modules, so I'll dig into that later.

Thanks :)


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
9 years ago
2,584 posts
Ahaa! It works for a vimeo, but not a youtube. That could well be one of my listeners messing with the youtube embed.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
douglas
@douglas
9 years ago
2,803 posts
Things could be worse, so I'm not complaining. ;)

Sounds like your on the right track to figuring this one out, let us know if you need help with anything.

Thanks!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
SteveX
SteveX
@ultrajam
9 years ago
2,584 posts
I'm on the right track, but I think it may be the jrYouTube module after all. I've run out of time for now.

There is definitely a problem within jrYouTube_extract_id, as http://youtu.be is hard coded, yet the urls I get from youtube are all https. So all youtube embeds fail at that point in jrYouTube_url_found_listener.

If I do pass a correct youtube id in at that point, jrYouTube_get_feed_data fails because of the curl call to youtube. I have an api key but cant validate the domain as that requires a different department to change the MX records. Seems overly complicated in order to embed a youtube?
---------
Update: I have validated the site (you can also do that through the search control panel by uploading a file), but the curl request still returns a 400 Bad Request.

Thanks


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 05/18/16 06:18:38AM
douglas
@douglas
9 years ago
2,803 posts
In your system check, does it show the YouTube V3 API Key as passing?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
SteveX
SteveX
@ultrajam
9 years ago
2,584 posts
Yes, it says "API Key is configured" for youtube.

Consumer key and secret are not set for Vimeo, but vimeo urls are converted to embeds fine.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
michael
@michael
9 years ago
7,793 posts
I've been playing with the youtube module over the last couple of days and haven't noticed any issues.

I'll try to setup as per steps here and see if I can recreate so its fixed with the next release. Probably able to figure out some steps from the conversation, but if you have some exact steps...... I like steps :)
michael
@michael
9 years ago
7,793 posts
following the steps in the first post, I turned on the jrUrlScan module.

Went to 'Global Config' and checked the 'Expanded Media' (because I like that more) :)

The "Active Text Formatters" were already set to allow 'Convert Embeded Tags'. Just to be sure, I clicked the "Apply to all quotas" anyhow and saved.

Next step, I went to a blog post, and updated. Found a random youtube video and copied its url:
https://www.youtube.com/watch?v=yMmrDpsYr0s
into the blog post.

EXPECTED:
That if there was a bug, the bug would be visible.

ACTUAL:
The video displayed in its converted state and was able to be watched.
Best Parkour and Freerunning
michael
@michael
9 years ago
7,793 posts
Ok, got it now, your getting urls like this from somewhere:
https://youtu.be/yMmrDpsYr0s

Thats failing. Will be fixed in the next version of jrYouTube.

Thanks.
michael
@michael
9 years ago
7,793 posts
fixed in jrYouTube 1.4.0. If you want the fix before that module is released, update jrYouTube/include.php function to this:
/**
 * Extract a YouTube ID from a string
 * @param $str string YouTube ID/URL
 * @return bool|string
 */
function jrYouTube_extract_id($str)
{ if (strlen($str) === 11 && !preg_match('/[^a-zA-Z0-9_-]/', $str)) { return $str; } // http://youtu.be/VXWF_yi5WB0 if (strpos($str, 'http://youtu.be/') === 0) { $id = trim(substr($str, 16)); if (strlen($id) === 11) { return $id; } } // https://youtu.be/VXWF_yi5WB0 if (strpos($str, 'https://youtu.be/') === 0) { $id = trim(substr($str, 17)); if (strlen($id) === 11) { return $id; } } // fall through parse_str(parse_url($str, PHP_URL_QUERY), $_tmp); if (isset($_tmp['v']) && strlen($_tmp['v']) === 11 && !preg_match('/[^a-zA-Z0-9_-]/', $_tmp['v'])) { return $_tmp['v']; } return false; }
SteveX
SteveX
@ultrajam
9 years ago
2,584 posts
Thanks Michael :)

I'm on holiday at the moment so I can't give that a try (can only ftp into the server from within the work network), but I will when I return.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
9 years ago
2,584 posts
Great stuff, that works perfectly now.

After updating the modules I continued to get errors, but found the reason for that - my Youtube v3 API Key had a space before and after. Although that works when you paste the url from the activity log into a browser, it fails via curl. I removed the spaces and everything worked fine, maybe the API key should be trimmed?

Thanks!


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
michael
@michael
9 years ago
7,793 posts
done, thanks. not big enough to warrant a release, but it will be trimmed in the next version.

Tags