Bug 14168 - enhance streaming cataloging to include youtube
Summary: enhance streaming cataloging to include youtube
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Mirko Tietgen
QA Contact: Testopia
URL:
Keywords: dependency
: 15964 (view as bug list)
Depends on:
Blocks: 21742
  Show dependency treegraph
 
Reported: 2015-05-07 15:49 UTC by Nicole C. Engard
Modified: 2018-10-31 20:21 UTC (History)
11 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 14168 - enhance streaming cataloging to include youtube (2.50 KB, patch)
2015-12-02 16:45 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 14168 PerlDependencies (765 bytes, patch)
2015-12-02 16:46 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 14168 - enhance streaming cataloging to include youtube (7.06 KB, patch)
2015-12-02 22:38 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 14168 - enhance streaming cataloging to include youtube (6.88 KB, patch)
2016-01-27 04:15 UTC, Mirko Tietgen
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14168 - enhance streaming cataloging to include youtube (6.97 KB, patch)
2016-01-28 00:38 UTC, Aleisha Amohia
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14168 - enhance streaming cataloging to include youtube (7.02 KB, patch)
2016-01-28 19:54 UTC, Nicole C. Engard
Details | Diff | Splinter Review
Bug 14168 - enhance streaming cataloging to include youtube (7.07 KB, patch)
2016-01-29 11:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14168 [QA Followup] - Fix typo (958 bytes, patch)
2016-01-29 11:46 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 14168 - Followup: make module WWW::YouTube::Download required (2.35 KB, patch)
2016-03-02 10:34 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 14168 Follow-up: require WWW::YouTube::Download only when syspref enabled (1.90 KB, patch)
2016-03-03 07:05 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 14168 Follow-up: require WWW::YouTube::Download only when syspref enabled (1.39 KB, patch)
2016-03-03 07:13 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 14168 Followup: Atomic update for syspref (943 bytes, patch)
2016-03-03 16:46 UTC, Mirko Tietgen
Details | Diff | Splinter Review
Bug 14168: (followup) require WWW::YouTube::Download only when syspref enabled (1.45 KB, patch)
2016-03-03 17:24 UTC, Jesse Weaver
Details | Diff | Splinter Review
Bug 14168: (followup) atomic update for syspref (2.26 KB, patch)
2016-03-03 17:24 UTC, Jesse Weaver
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2015-05-07 15:49:29 UTC
Would be nice if you could catalog youtube videos and have them steam in Koha like you can other HTML5 videos.  We might be able to use something like https://metacpan.org/pod/WWW::YouTube::Download for this
Comment 1 Nicole C. Engard 2015-05-07 15:53:14 UTC
an idea from drojf:


soething like this http://www.htmlgoodies.com/imagesvr_ce/9722/youtube3.jpg and if you catalogue the url part, the rest around it could be generated. still a new feature though
Comment 2 Mirko Tietgen 2015-05-08 12:14:24 UTC
I have a prototype that uses https://metacpan.org/pod/WWW::YouTube::Download to resolve the webm video link on the fly from a regular youtube link catalogued in 856$u. I will upload it when I had some more time for testing.

Two things:

- WWW::YouTube::Download is packaged for Debian Jessie, but not Wheezy. It depends on libxml-treepp-perl which is available on both systems. Have not checked Ubuntu. Probably have to ask Robin what to do about that. I rolled a package for Wheezy to test, I will upload it or link to it so the patch can be tested.

- I have no idea if this is compliant to Youtube TOS. It does the same thing as your browser would if you opened the Youtube link: check for the file in a desired format and then play it. Link is generated on the fly, nothing is downloaded and stored anwhere on the Koha server. The video file is sent directly to the person opening the record.
Comment 3 Nicole C. Engard 2015-05-29 18:28:36 UTC
Any luck getting this turned in to a patch?
Comment 4 Mirko Tietgen 2015-12-02 16:45:54 UTC Comment hidden (obsolete)
Comment 5 Mirko Tietgen 2015-12-02 16:46:30 UTC Comment hidden (obsolete)
Comment 6 Mirko Tietgen 2015-12-02 16:49:59 UTC
Needs libwww-youtube-download-perl to work, which is in Jessie. https://packages.debian.org/jessie/libwww-youtube-download-perl

Hardcoded video format: WEBM.

Todo:
- scans only for /youtube/ in the URL, should also know relevant URL shorteners
- syspref (youtube yes/no?)
- probably more :)
Comment 7 Mirko Tietgen 2015-12-02 16:50:34 UTC
todo
- add dependency to debian/contol
Comment 8 Mirko Tietgen 2015-12-02 22:38:11 UTC Comment hidden (obsolete)
Comment 9 Mirko Tietgen 2015-12-03 13:43:54 UTC
I forgot to say that the following still applies:

Needs libwww-youtube-download-perl to work, which is in Jessie. https://packages.debian.org/jessie/libwww-youtube-download-perl

Install it before testing :) The Jessie module will likely work in Wheezy too.
Comment 10 Aleisha Amohia 2016-01-21 22:01:05 UTC
Applying: Bug 14168 - enhance streaming cataloging to include youtube
/home/vagrant/kohaclone/.git/rebase-apply/patch:47: trailing whitespace.
                        $HTML5Media_field->subfield('u'), { 
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
<stdin>:47: trailing whitespace.
                        $HTML5Media_field->subfield('u'), { 
warning: 1 line applied after fixing whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging installer/data/mysql/sysprefs.sql
Auto-merging C4/Installer/PerlDependencies.pm
CONFLICT (content): Merge conflict in C4/Installer/PerlDependencies.pm
Auto-merging C4/HTML5Media.pm
CONFLICT (content): Merge conflict in C4/HTML5Media.pm
Failed to merge in the changes.
Comment 11 Mirko Tietgen 2016-01-27 04:15:47 UTC Comment hidden (obsolete)
Comment 12 Mirko Tietgen 2016-01-27 04:16:47 UTC
Aleisha, thanks for testing! I rebased the patch.
Comment 13 Aleisha Amohia 2016-01-27 21:28:16 UTC
Hi Mirko, patch applied fine but I got a software error while going on to a biblio detail page (ie catalogue/detail.pl).

Can't locate WWW/YouTube/Download.pm in @INC (@INC contains: /home/vagrant/kohaclone /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /home/vagrant/kohaclone/C4/HTML5Media.pm line 26.
BEGIN failed--compilation aborted at /home/vagrant/kohaclone/C4/HTML5Media.pm line 26.
Compilation failed in require at /home/vagrant/kohaclone/catalogue/detail.pl line 42.
BEGIN failed--compilation aborted at /home/vagrant/kohaclone/catalogue/detail.pl line 42.
Comment 14 Mirko Tietgen 2016-01-27 23:15:20 UTC
Aleisha, please see comment 9 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14168#c9

You need to have the package libwww-youtube-download-perl installed.
Comment 15 Aleisha Amohia 2016-01-28 00:38:26 UTC Comment hidden (obsolete)
Comment 16 Nicole C. Engard 2016-01-28 19:54:38 UTC Comment hidden (obsolete)
Comment 17 Kyle M Hall 2016-01-29 11:46:33 UTC
Created attachment 47459 [details] [review]
Bug 14168 - enhance streaming cataloging to include youtube

Add optional embedding of YouTube videos via HTML5Media.
New syspref: HTML5MediaYouTube: Embed/Don't embed videos.
Format WEBM is hardcoded as it is the only format accepted by all
modern browsers.

Test plan:
- apply patch
- catalogue a YouTube link in 856$u
- turn on HTML5MediaEnabled and HTML5MediaYouTube
- open the record in OPAC and staff client, check that the
  'Play media' tab is showing and playing the video works.

Possible enhancements for followups:
- check available formats, offer quality choice
- accept official YT URL shortener

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Works perfectly!

Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 18 Kyle M Hall 2016-01-29 11:46:41 UTC
Created attachment 47460 [details] [review]
Bug 14168 [QA Followup] - Fix typo

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 19 Brendan Gallagher 2016-03-02 00:41:36 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!
Comment 20 Josef Moravec 2016-03-02 10:34:45 UTC Comment hidden (obsolete)
Comment 21 Brendan Gallagher 2016-03-02 21:49:09 UTC
Just marking that last patch - as not obsolete until we've got another patch that does what we need.
Comment 22 Josef Moravec 2016-03-02 22:08:43 UTC
Héctor moved the patch to newly created bug 15964, that's propably the reason of obsoleting my followup here.
Comment 23 Mirko Tietgen 2016-03-03 07:05:18 UTC Comment hidden (obsolete)
Comment 24 Mirko Tietgen 2016-03-03 07:11:31 UTC
I added a followup. Expected results:

- without libwww-youtube-download-perl
-- HTML5MediaYouTube disabled: detail views work fine
-- HTML5MediaYouTube enabled: detail views throw an error ('Can't locate WWW/YouTube/Download.pm in @INC …')

- with libwww-youtube-download-perl
-- HTML5MediaYouTube disabled: detail views work fine
-- HTML5MediaYouTube enabled: detail views work fine and YT video works

I can't switch this back to needs signoff for some reason.
Comment 25 Mirko Tietgen 2016-03-03 07:13:13 UTC Comment hidden (obsolete)
Comment 26 Jonathan Druart 2016-03-03 15:59:35 UTC
New pref not added by the update DB process, please fix asap.
Comment 27 Mirko Tietgen 2016-03-03 16:46:43 UTC Comment hidden (obsolete)
Comment 28 Jesse Weaver 2016-03-03 17:24:06 UTC
Created attachment 48643 [details] [review]
Bug 14168: (followup) require WWW::YouTube::Download only when syspref enabled

This patch fixes the problem of missing WWW::YouTube::Download breaking
record detail views. Instead of a general 'use', the module is only
required if the related syspref is enabled.

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Comment 29 Jesse Weaver 2016-03-03 17:24:13 UTC
Created attachment 48644 [details] [review]
Bug 14168: (followup) atomic update for syspref

Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Fixed small typo (extra ').
Comment 30 Brendan Gallagher 2016-03-03 19:13:33 UTC
Ok I should be caught up on this one now.  Please let me know if I did something screwy or missed something.  

Thanks much
Comment 31 Mirko Tietgen 2016-05-25 17:43:39 UTC
*** Bug 15964 has been marked as a duplicate of this bug. ***