Help with YouTube integration

182 views
Skip to first unread message

Max Lira

unread,
Sep 16, 2016, 8:44:09 PM9/16/16
to Opencast Users
Hi, I have a problem with YouTube integration

First I followed the instructions in the documentation here https://docs.opencast.org/latest/admin/modules/youtubepublication/

I have problem with this Step:

Generate OAuth Tokens

  • Start Opencast
  • Follow the request URL appearing in the Opencast logs and click Accept
  • The resulting website will say Received verification code. Closing...
The URL that Opencast gave me (retrieved with "systemctl status opencast -l") I copy and paste in my browser, appears a google page that let me choose the channel and if I allow the connection, I press allow and gave me the browser this error: "Impossible to connect to localhost:40696"

The URL opencast give me is (Changed some values of the keys for security reasons):

https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=auto&client_id=894220757394-chasck8g4n4b4f7p9cfck4aqvjqb3ft3.apps.googleusercontent.com&redirect_uri=http://localhost:40696/Callback&response_type=code&scope=https://www.googleapis.com/auth/youtube%20https://www.googleapis.com/auth/youtube.upload%20https://www.googleapis.com/auth/youtube.readonly

What I have to do?

Max Lira

unread,
Sep 16, 2016, 9:26:27 PM9/16/16
to Opencast Users
Updating the info, I just manually put the code in the server.

You need to add in the documentation that the localhost direction hast to be run in the server using the curl command.

Now I still have the youtube option in the add event menu grayed out, What I have missing?

In other hand, I have found in ""/etc/opencast/org.opencastproject.pm.impl.scheduling.ScheduleFeederServiceImpl.cfg"" this lines:


# Youtube delivery
org.opencastproject.publication.youtube.username=CHANGE_ME
org.opencastproject.publication.youtube.password=CHANGE_ME
org.opencastproject.publication.youtube.clientid=CHANGE_ME
org.opencastproject.publication.youtube.developerkey=CHANGE_ME
org.opencastproject.publication.youtube.category=CHANGE_ME

# Additional keywords to add to recordings
org.opencastproject.publication.youtube.keywords=CHANGE_ME
org.opencastproject.publication.youtube.private=CHANGE_ME
org.opencastproject.publication.youtube.default.playlist=CHANGE_ME


I have to fill that to make it work? With what keys I have to fill?

Lars Kiesow

unread,
Sep 18, 2016, 7:55:32 AM9/18/16
to us...@opencast.org
Hi Max.
just ignore that configuration file. It shouldn't even be there and
will have no effect on your problem.

What you need to do is to create your own workflow. The default
workflow will not publish to YouTube.

Regards,
Lars
> >> - Start Opencast
> >> - Follow the request URL appearing in the Opencast logs and
> >> click *Accept*
> >> - The resulting website will say Received verification code.

Max Lira

unread,
Sep 19, 2016, 3:26:54 PM9/19/16
to Opencast Users
Hi Lars, I made a new workflow (Attached in this message), but Still it's skipped from Opencast, the log file didn't say anything either.

I think that the publish-youtube WOH it's the issue, but there is no documentation about how to use it.

Has someone a working workflow with youtube? There is another thing to do?
ng-schedule-and-upload-youtube.xml

Greg Logan

unread,
Sep 19, 2016, 4:34:27 PM9/19/16
to Opencast Users
Lars, are we sure that the YouTube integration is actually working?  The pull request from John Crossman never made it into the codebase, and (afaik) the big reason he was working on that was that the API was broken, or about to be.

G

--
You received this message because you are subscribed to the Google Groups "Opencast Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.

Lars Kiesow

unread,
Sep 19, 2016, 5:53:24 PM9/19/16
to us...@opencast.org
Afaik, the pull request from John was just an improvement. I have seen
it working after this pull request against 2.0:

https://bitbucket.org/opencast-community/matterhorn/pull-requests/407/mh-10636-add-youtube-api-v3-module/diff

This is basically the current state. I myself have, however, never
tried to publish to YouTube.

Max, your workflow is definitely missing the YouTube workflow operation
handler. Have a look at the above mentioned pull request for an example:

https://bitbucket.org/opencast-community/matterhorn/pull-requests/407/mh-10636-add-youtube-api-v3-module/diff#Letc/workflows/compose-distribute-publish.xmlT505

You have to adjust the conditions, … though.

Regards,
Lars

Max Lira

unread,
Sep 19, 2016, 9:58:13 PM9/19/16
to Opencast Users
Thanks Lars for the resource,

In the workflow I attached, the youtube WOH is not there. I'm using the youtube WOH in ng-partial-publish.xml, after I modified that file with the resource you gave me I changed this:

<operation      id="publish-youtube"
     
if="${publishToYouTube}"
     
max-attempts="2"
     
exception-handler-workflow="ng-partial-error"
     
description="Publishing to YouTube">
     
<configurations>
       
<configuration key="source-tags">engage-download</configuration>
     
</configurations>

   
</operation>






To this:

 <operation
     
id="publish-youtube"
     
if="${publishToYouTube}"
     
max-attempts="2"
     
fail-on-error="true"
     
exception-handler-workflow="error"
     
description="Publish to YouTube">
     
<configurations>
       
<configuration key="source-flavors">presentation/trimmed</configuration>
     
</configurations>
   
</operation>




And  It worked like a charm.

Now I understand the context of this bug https://opencast.jira.com/browse/MH-10920

Next I have to configure the metadata in "/etc/opencast/org.opencastproject.publication.youtube.YouTubeV3PublicationServiceImpl.cfg" I found an example from the opencast fork of UCB:

Modify the values in the mentioned cfg file, for something like this:

org.opencastproject.publication.youtube.category=Education
org
.opencastproject.publication.youtube.keywords=uc, berkeley, ucberkeley, webcast.berkeley, cal
org
.opencastproject.publication.youtube.makeVideosPrivate=true
org
.opencastproject.publication.youtube.makeVideosPrivate_prod=false
org
.opencastproject.publication.youtube.defaultPlaylist=uncategorized





I hope this information will help to others to get their videos published in Youtube.

Summing-up:
To make work YouTube publishing with the default config.
  1.  Follow the youtube documentation, in the part to follow the url in the browser, when the browser tries to go to localhost:4... Copy that line and run in the server command line using curl (Or follow the url if you are using the browser in the server)
  2. Paste the workflow I attached in my previous answer to in "/etc/opencast/workflows"
  3. Change in "ng-partial-publish.xml" The youtube part mentioned above
  4. Try with a sample in the presenter stream.

_________________________________________________________________________________________________

In another topic for this:

Has anyone tried to merge the presenter and the presentation stream in one video to later publish in youtube?


Regards

Lars Kiesow

unread,
Sep 20, 2016, 9:20:16 AM9/20/16
to us...@opencast.org
Hi Max,
it is great to hear that things now work. You now have the unique
knowledge to know what you have to do for a YouTube integration. Would
you mind extending the documentation?

You can find the current guide at:

docs/guides/admin/docs/modules/youtubepublication.md

You can also find a simple tutorial on how to create documentation pull
requests here:

https://youtu.be/QzBtQkk97Ls

Regards,
Lars
> *Summing-up:*
> To make work YouTube publishing with the default config.
>
> 1. Follow the youtube documentation, in the part to follow the
> url in the browser, when the browser tries to go to localhost:4...
> Copy that line and run in the server command line using curl (Or
> follow the url if you are using the browser in the server)
> 2. Paste the workflow I attached in my previous answer to in
> "/etc/opencast/workflows"
> 3. Change in "ng-partial-publish.xml" The youtube part mentioned
> above 4. Try with a sample in the presenter stream.
> > > > it, send an email to users+un...@opencast.org <javascript:>.
> > > >
> > >
> >
> >
>

Max Lira

unread,
Sep 20, 2016, 11:04:04 AM9/20/16
to Opencast Users
Thanks for your support!

I will do that in the documentation in the next days, I'm working now documenting the Opencast + Galicaster deployment in Spanish.

Can Opencast merge the presenter and the presentation in one video side by side using FFMPEG? I saw a post from John Crossman in the FFMPEG forums talking about this and it's possible to do that https://ffmpeg.org/pipermail/ffmpeg-user/2013-June/015662.html

Have anyone tried to do a workflow that get that type of video? This would be useful for youtube publish.

Lars Kiesow

unread,
Sep 20, 2016, 12:17:46 PM9/20/16
to us...@opencast.org
Hi Max,
yes you can do that. Have a look at the composite operation. It is
actually used already for the video editor preview.
–Lars

On Tue, 20 Sep 2016 08:04:03 -0700 (PDT)

Steven Hsiao

unread,
Dec 22, 2016, 11:14:40 PM12/22/16
to us...@opencast.org
Hi, Max
I am not aware of the meaning of the summing-up step1,I run opencast 2.2.4 source installation on ubuntu 14.04 ,Pleas give more hint about that

thanks

********************

  1.  Follow the youtube documentation, in the part to follow the url in the browser, when the browser tries to go to localhost:4... Copy that line and run in the server command line using curl (Or follow the url if you are using the browser in the server)
--
蕭孟達/Steven Hsiao
Mobile Phone# 0926-109741
靈糧一線領袖培訓學院
網址 : leadership.llcgm.net
地址 : 台北市文山區興隆路四段111號B1
電話 : (02) 2234-7450 轉 15
@@@@ 耶穌愛你 賜你平安 @@@@

Steven Hsiao

unread,
Dec 25, 2016, 10:26:36 AM12/25/16
to us...@opencast.org
Hi,
I have followed all the steps from Max's instruction , and sucessfully sent a presenter file by choosing the workflow ng-schedule-and-upload-youtube.xml,
but the problem is I did not get reaction on my youtube channel。 Is there anyone give help, 
My sever is Opencast 2.2.4 set on ubuntu 14.04 source installation

Thanks

Steven Hsiao

Maximiliano Lira Del Canto

unread,
Dec 25, 2016, 10:33:09 AM12/25/16
to Opencast Users
Hi, Merry Christmass to all of you in this Board.

Steven, in you installation, Did you configure the Youtube API as in the opencast documentation?, Did you enabled the youtube plugin?

The video uploads in your channel you configured earlier when you create the access code.

Maximiliano Lira Del Canto
Ingeniero Civil Telemático
Teléfono: +569-89198850
Viña del Mar, Chile

Steven Hsiao

unread,
Dec 25, 2016, 11:02:22 AM12/25/16
to us...@opencast.org
Hi, Max happy Chrismas

giving  my operation setting as belows :  
1. I apply Youtube API "installed " application file, and download json file :

 {"installed":{"client_id":"611356074584-ns2am4tr43hij0t7ec8ohtqqph70kfa6.apps.googleusercontent.com","project_id":"pumukit--XXXXX","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"Kf_gh01-50W7xKV3SvSPFYzG","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}

2. and I put it to opencast path : /opt/opencast/etc/youtube-v3/client-secrets-youtube-v3.json

3. and Start Opencast : service opencast restart

4. get opencast logfile : https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=auto&client_id=611356074584-ns2am4tr43hij0t7ec8ohtqqph70kfa6.apps.googleusercontent.com&redirect_uri=http://localhost:36561/Callback&response_type=code&scope=https://www.googleapis.com/auth/youtube%20https://www.googleapis.com/auth/youtube.upload%20https://www.googleapis.com/auth/youtube.readonly

5. get Received verification code. Closing...from browser

6. send a presenter file using ng-schedule-and-upload-youtube.xml

7. but fail to get the file on youtube channel


how can I resove it ,please help


Steven Hsiao

Maximiliano Lira Del Canto

unread,
Dec 25, 2016, 12:16:46 PM12/25/16
to Opencast Users
did you open the url in the logfile in the server? or in another pc?

Maximiliano Lira Del Canto
Ingeniero Civil Telemático
Teléfono: +569-89198850
Viña del Mar, Chile

Steven Hsiao

unread,
Dec 25, 2016, 8:44:59 PM12/25/16
to us...@opencast.org
Hi, Max 

my operation steps are as follow
1. Start Opencast , 
2. cut the url from logfile , 
3. and paste on thㄔe external browser,then youtube channel authority popup , click Accept/Permit  tag , 
4. get another url in address bar, then open it in the server browser using curl 
    received returning message :

<html>
<head><title>OAuth 2.0 Authentication Token Recieved</title></head>
<body>
Received verification code. Closing...
<script type='text/javascript'>
window.setTimeout(function() {
    window.open('', '_self', ''); window.close(); }, 1000);
if (window.opener) { window.opener.checkToken(); }
</script>
</body>
</HTML>
but still fail to get reaction on youtube channel after sending a presenter file via opencast


Steven Hsiao

unread,
Dec 25, 2016, 8:54:49 PM12/25/16
to us...@opencast.org
I am not so sure
Do I need to configurate etc/org.opencastproject.publication.youtube.YouTubePublicationServiceImpl.cfg ?
or just follow the configuration etc/org.opencastproject.publication.youtube.YouTubeV3PublicationServiceImpl.cfg instead ?



Maximiliano Lira Del Canto

unread,
Dec 26, 2016, 6:25:18 AM12/26/16
to Opencast Users
Yes, you are doing it right.

About the CFG, its not necessary to use it.

When you use the workflow:
-did you activate the youtube publish check box?
-When is working, what happens when opencast have to use the youtube module?

Maximiliano Lira Del Canto
Ingeniero Civil Telemático
Teléfono: +569-89198850
Viña del Mar, Chile

Steven Hsiao

unread,
Dec 26, 2016, 6:32:12 AM12/26/16
to us...@opencast.org
內置圖片 2內置圖片 3

Maximiliano Lira Del Canto

unread,
Dec 26, 2016, 6:36:06 AM12/26/16
to Opencast Users
Go to your youtube channel (logged with the account you used it), normally, the video is uploaded as private.

Maximiliano Lira Del Canto
Ingeniero Civil Telemático
Teléfono: +569-89198850
Viña del Mar, Chile

Steven Hsiao

unread,
Dec 26, 2016, 6:51:21 AM12/26/16
to us...@opencast.org
Hi, Max

I checked in youtube channel with my account

please check for me if  file content is correct,when I received verification code, there  is a file was created in the path /opt/opencast/data/opencast/youtube-v3/data-store/store

and the file content show as follows

¬í^@^Esr^@^Qjava.util.HashMap^E^GÚÁÃ^V`Ñ^C^@^BF^@
loadFactorI^@   thresholdxp?@^@^@^@^@^@^Lw^H^@^@^@^P^@^@^@^At^@G21942952527-ec76i2k5cagc8748p53p7a371b0i3777.apps.googleusercontent.comur^@^B[B¬ó^Wø^F^HTà^B^@^@xp^@^@^C>¬í^@^Esr^@2com.google.api.client.auth.oauth2.StoredCredential^@^@^@^@^@^@^@^A^B^@^DL^@^KaccessTokent^@^RLjava/lang/String;L^@^ZexpirationTimeMillisecondst^@^PLjava/lang/Long;L^@^Dlockt^@!Ljava/util/concurrent/locks/Lock;L^@^LrefreshTokenq^@~^@^Axpt^@Gya29.Ci_AA8CZ6TgyjZrwtql6VS0LQbwWsnj3Fth4Vzab2RoXJwcPkLlN6koGEXyPonwIlwsr^@^Njava.lang.Long;<8b>ä<90>Ì<8f>#ß^B^@^AJ^@^Evaluexr^@^Pjava.lang.Number<86>¬<95>^]^K<94>à<8b>^B^@^@xp^@^@^AY:õ^PLsr^@(java.util.concurrent.locks.ReentrantLockfU¨,,Èjë^B^@^AL^@^Dsynct^@/Ljava/util/concurrent/locks/ReentrantLock$Sync;xpsr^@4java.util.concurrent.locks.ReentrantLock$NonfairSynce<88>2çS{¿^K^B^@^@xr^@-java.util.concurrent.locks.ReentrantLock$Sync¸^^¢<94>ªDZ|^B^@^@xr^@5java.util.concurrent.locks.AbstractQueuedSynchronizerfU¨Cu?Rã^B^@^AI^@^Estatexr^@6java.util.concurrent.locks.AbstractOwnableSynchronizer3߯¹­mo©^B^@^@xp^@^@^@^@t^@B1/UFO7PH8gh6hspFL4csJHsAQBC64ju-uP0c3PphuSFh7vdZaxI_HEMDgIyojOxQ1Yx

is it a correct format?

Thanks

Steven Hsiao


Max Lira

unread,
Jan 9, 2017, 1:54:18 PM1/9/17
to Opencast Users
Lars, I've just made a pull request with the new documentation for this step.

Steven, Have you solved your problem?


El viernes, 16 de septiembre de 2016, 21:44:09 (UTC-3), Max Lira escribió:

Lars Kiesow

unread,
Jan 9, 2017, 4:30:19 PM1/9/17
to us...@opencast.org
That is great. Thanks, Max!
I'll take up the review asap :)
–Lars

On Mon, 9 Jan 2017 10:54:18 -0800 (PST)
Max Lira <max...@gmail.com> wrote:

> Lars, I've just made a pull request with the new documentation for
> this step.
>
> Steven, Have you solved your problem?
>
> El viernes, 16 de septiembre de 2016, 21:44:09 (UTC-3), Max Lira
> escribió:
> >
> > Hi, I have a problem with YouTube integration
> >
> > First I followed the instructions in the documentation here
> > https://docs.opencast.org/latest/admin/modules/youtubepublication/
> >
> > I have problem with this Step:
> >
> > Generate OAuth Tokens
> >>
> >> - Start Opencast
> >> - Follow the request URL appearing in the Opencast logs and
> >> click *Accept*
> >> - The resulting website will say Received verification code.

Steven Hsiao

unread,
Jan 9, 2017, 6:35:24 PM1/9/17
to us...@opencast.org
Hi,Max
I did not find solution so far, but i got logfile  : 
2017-01-09 18:19:05,555 | INFO  | (PublishYouTubeWorkflowOperationHandler:136) - No mediapackage element was found for publishing




--
You received this message because you are subscribed to the Google Groups "Opencast Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.

Steven Hsiao

unread,
Jan 9, 2017, 6:57:04 PM1/9/17
to us...@opencast.org
I have successfully made it by revising source flovours ,Thanks

if you want to publish the presentation stream, you have to change the line from `presenter/trimmed` to `presentation/trimmed` 


--
You received this message because you are subscribed to the Google Groups "Opencast Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.

Steven Hsiao

unread,
Jan 9, 2017, 7:09:00 PM1/9/17
to us...@opencast.org
+1

To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.
Reply all
Reply to author
Forward
0 new messages