XBMC Community Forum
Offline Creator - Automated dummy content script/program - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for XBMC (/forumdisplay.php?fid=116)
+--- Thread: Offline Creator - Automated dummy content script/program (/showthread.php?tid=40329)

Pages: 1 2 3 4


Offline Creator - Automated dummy content script/program - sw1tch - 2008-11-14 01:11

Something that I hope should be useful to anyone with lots of offline content such as DVD's. This will automate the process of creating dummy files used for XBMC library scanning and create avi's that tell you what disc the content is on when you play that library item.

It's only a simply console application, no fancy gui.

Features:
- Loads a list of Movies and Disc Numbers from a .cvs file
- Creates dummy folders (optional)
- Fetches the url for the top imdb result and creates and .nfo file for easy XBMC lookup (optional)
- Fetches the year from imdb (optional)
- Creates an avi file containing the text "Please Insert Disc X" where X is the Disc Number for that Film.

[Image: insertdiscca4.png]

Download Offline Creator v1.2(WINDOWS)

Download Offline Creator v1.3(Linux/OSX)

Quote: Changelog
================================================
- 1.3
Fixed: Running under linux would not create the video (no such file or directory error)
- 1.2
Added an option for using a background image instead of just black
Added an option for using a custom font - be aware the text may not center properly
- 1.1
Added the ability to change the "Please Insert Disc" text to custom text in settings.ini

To use,
1) Edit library.cvs in excel/notepad to include your movie names, and disc ids(optional)
2) Run the program
3) Scan the Offline folder in XBMC
See the readme.txt for information on usage.

For the next version I will look into fetching posters and adding a "DVD" watermark, and possibly allowing custom backgrounds for the dummy avi files.


- wyild1 - 2008-11-22 05:04

Looks promising! Testing this out and i have run into a bit of a program. I created the csv file with about 30 movies but when i run the script i get:
Code:
wyild1@BITCHTITS:~/offline-creator$ python offlinecreator.py
# - Skipped Creating Image -- Moviez5.png
# - Creating Video -- Moviez5.avi
Traceback (most recent call last):
  File "offlinecreator.py", line 62, in <module>
    vid_maker._create_vid(i)
  File "/home/wyild1/offline-creator/lib/video_maker.py", line 28, in _create_vid
    self._run_command(command)
  File "/home/wyild1/offline-creator/lib/video_maker.py", line 49, in _run_command
    startupinfo=stup, creationflags=creationflags)
  File "/usr/lib/python2.5/subprocess.py", line 594, in __init__
    errread, errwrite)
  File "/usr/lib/python2.5/subprocess.py", line 1147, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Any thoughts?


- desertblade - 2009-01-01 23:54

This a great idea! I would like to see some of the suggested ideas but what a great start. I just need to add all my movies to the collection.

wyild1 I too got this error on Linux, it is having issues creating the movie folder names, I could dig into why, but my Python is not very good.

I tried it out on windows with the exe and it works great, so for now my workaround is using the VM of windows that I have.


- stacked - 2009-01-02 01:08

Thank you so much! I've needed something like this. It works perfectly with Ant Movie Catalog. I just export my movies list to csv with the title and the disc number, then let this program do the magic. I already have nfo files with the proper imdb urls but I like that you have an imdb url scraper built in.

My only request is that you allow the user to change the text "Please Insert Disc" in the settings.ini. And also allow the user to choose a delimiter instead of comma. I ran into problems when movie titles had commas like "I, Robot" or "Me, Myself & Irene".

Thanks again! Big Grin


- xbmcjb - 2009-01-03 00:49

Hi,

Thanks ! Works great !
But if you try to use letters for your disc ids, the app put a cap for the first letter and don't respect the case of the text in the "library.csv".

It should not be too difficult to fix.

Thanks in advance


- sw1tch - 2009-01-03 17:56

xbmcjb Wrote:Hi,

Thanks ! Works great !
But if you try to use letters for your disc ids, the app put a cap for the first letter and don't respect the case of the text in the "library.csv".

It should not be too difficult to fix.

Thanks in advance

Open up settings.ini in wordpad and change
Code:
title_names = True
to
Code:
title_names = False



wyild1 Wrote:Looks promising! Testing this out and i have run into a bit of a program. I created the csv file with about 30 movies but when i run the script i get:
Code:
wyild1@BITCHTITS:~/offline-creator$ python offlinecreator.py
# - Skipped Creating Image -- Moviez5.png
# - Creating Video -- Moviez5.avi
Traceback (most recent call last):
  File "offlinecreator.py", line 62, in <module>
    vid_maker._create_vid(i)
  File "/home/wyild1/offline-creator/lib/video_maker.py", line 28, in _create_vid
    self._run_command(command)
  File "/home/wyild1/offline-creator/lib/video_maker.py", line 49, in _run_command
    startupinfo=stup, creationflags=creationflags)
  File "/usr/lib/python2.5/subprocess.py", line 594, in __init__
    errread, errwrite)
  File "/usr/lib/python2.5/subprocess.py", line 1147, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

Any thoughts?

Have you installed mencoder? See the readme, you may need to specify the location of mencoder in the ini

stacked Wrote:Thank you so much! I've needed something like this. It works perfectly with Ant Movie Catalog. I just export my movies list to csv with the title and the disc number, then let this program do the magic. I already have nfo files with the proper imdb urls but I like that you have an imdb url scraper built in.

My only request is that you allow the user to change the text "Please Insert Disc" in the settings.ini. And also allow the user to choose a delimiter instead of comma. I ran into problems when movie titles had commas like "I, Robot" or "Me, Myself & Irene".

Thanks again! Big Grin

CSV files require items with commas in to be quoted such as
Code:
The Matrix, 1
"I, Robot", 2
If Ant Movie Catalog is not exporting the csv this way, then you will need to take it up with them.

As for the custom "Please Insert Disc", I have just added the option into settings.ini in the latest version, see the original post.
Quote: Changelog
================================================
- 1.1
Added the ability to change the "Please Insert Disc" text to custom text in settings.ini



- stacked - 2009-01-03 21:18

sw1tch Wrote:CSV files require items with commas in to be quoted such as
Code:
The Matrix, 1
"I, Robot", 2
If Ant Movie Catalog is not exporting the csv this way, then you will need to take it up with them.

Oh, I forgot to include the quotes on the export settings.

Thanks for the update too.


- xbmcjb - 2009-01-03 23:39

Some other suggestions :

- You could add an item in settings.ini to change the font
Code:
font = helvetica.ttf
(the workaround for now is to rename an other font to ARIAL.TTF and put it instead of the default one)

- Is it possible to add a background image instead of black ?

Anyway, these are details. Thanks for the update.


- Gamester17 - 2009-01-04 02:05

@sw1tch, could you please through in an option to create the dummy files/folders structure without the NFO files?

Dummy file/folder structures are great for testing XBMC on different platforms, and to show of to your friends on their own computers, ...but I do not want the NFO files.

Wink


- blittan - 2009-01-04 11:47

@Gamester17, simply do a search for *.nfo in the dummyfolder then Wink