ReplaceVideo.py


#1

Hello everybody,
On the page [https://blog.xibo.org.uk/scripting-xibo-content-management-a-brief-tour-of-the-api/]
it is said :
“You can download the completed ReplaceVideo.py file here.”, but when i clic on the link ReplaceVideo ( [https://blog.xibo.org.uk/wp-content/uploads/2014/02/replacevideo.py/]
i obtain the message Page “not found”.
Where can i find the example?
Thanks


#2

Due to the age of the Blog Post, the ReplaceVideo.py file is no longer available to download from the link.

The Blog post does include instructions on how to create ReplaceVideo.py, although I do acknowledge that the formatting may make that a little tricky. Please also note that the ReplaceVideo.py program will only work with version 1.7 of Xibo.

I have included a link below to our API Introduction Guide for 1.8, which may also help you.

My apologies for any inconvenience.

Many Thanks.


#3

Hello,
Thanks for your answer.
I want write a php script for replacing automatically, with crontab, a pdf file in a layout.
I don’t know how to use the API with php.
Where could i find examples to guide me?
I use xibo CMS 1.8.9 on a Raspberry.
Thanks


#4

The guide Daniel linked you to tells you how to interact with the API. You need to read and understand that.


#5

Hello,
I read the guide.
I installed Postman on my PC;
I use “POST library upload” with params oldMediaId, updateInLayouts, and deleteOldRevisions.
I obtain the result:
{“files”:[{“name”:“annonces_17_18_nov.pdf”,“size”:602526,“type”:“application/pdf”,“url”:"/api/library?file=annonces_17_18_nov.pdf&download=1",“mediaId”:62,“storedas”:“62.pdf”,“duration”:60,“retired”:0,“fileSize”:602526,“md5”:“16721bf925005102a450159f8449cc6c”,“delete_url”:"/api/library?file=annonces_17_18_nov.pdf",“delete_type”:“DELETE”}]}

But, in CMS, in the page “layout/view”, the “Etat” of the layout becomes the icon “gear” and i must
ask “Aperçu de la Mise en Page” to obtain the tic in the column “Etat”.

Is there a way to do all with Postman ?

Thanks.


#6

When you edit a layout, it will go to a gear icon as you’ve seen.

XTR will come along and build that layout for you next time it runs. If the icon never changes, please ensure you have XTR configured and running and that none of your tasks are in an error state.


#7

Hello everybody,
As it seems preferable to use docker installation, i try to reinstall my xibo on raspberry stretch with compose-ce.
In /opt/xibo i run “docker-compose up -d” an i obtain the message:
*Creating network “xibo_default” with the default driver
Pulling cms-db (mysql:5.6)…
5.6: Pulling from library/mysql

Can you help me?
Thanks


#8

You need a 64 bit amd64 CPU. A Raspberry Pi doesn’t have that, so it won’t work.


#9

Hi Dan

who maintains the old guides. I understand that replacevideo.py only works on 1.7 , but surely what needs to be done is update these guides :slight_smile:

My technical ability is not up to much , but editing guides to makes sure broken links are’nt hanging around , well I’m sure i can do that.

If I can help, let me know


#10

@natasha can you pick this up please?

Guide either needs to be removed or marked more clearly as 1.7 only, and find a copy of the missing resources.


#11

Please note: As this guide refers to Xibo 1.7 only it been retired from our catalogue of updated Guides. For future reference please use the API Introduction Guide 1.8

Thank you


#12

Hello everybody,
I re-install xibo-1.8.11 on a raspberry, and xibo-client on windows 7. All work fine.
I use postman,on a windows 10 PC, to replace a pdf file with “POST access token” and “POST Library Upload” and it work fine so.
On the raspberry i made a program with the python codes from postman.
I obtain a token, the mediaId of the pdf file to replace, but with the code corresponding to “Library upload” i obtain an error message with:

{“files”:[{“name”:“annonces.pdf”,“size”:0,“type”:“application/pdf”,“error”:“File is too small”}]}

I suppose it doesn’t find the file. Where do i must put this file on the raspberry?

The idea is to download, periodically, the pdf file from a web site, and replace the file which is shown on the player.

Thanks.


#13

You’re telling the CMS that the file size is 0. You need to send a valid size.


#14

Hello,
Thanks.
But :

  • the code generated by Postman doesn’t show the parameter size;
  • in the manual swagger.json , “POST /library” there are only “files, name, oldMediaId, updateInLayouts, deleteOldRevisions” parameters.
    How can i specify the size?

When i use postman i spcify the location of the file on the PC , with the button “Select fichier” in the parameter “files”.
On the raspberry i give the path of the file, for example “/home/pi/annonces.pdf” or something else, but i obtain the same message.

Thanks.