2009-08-12, 08:35
blittan Wrote:special://xbmc/scripts are more accurate
My apologies then. I got the info from the forum.
Zeljko
blittan Wrote:special://xbmc/scripts are more accurate
blittan Wrote:special://xbmc (where the executable resides)
special://home (a writable version of special://xbmc)
special://masterprofile (the “master” userdata folder, usually special://home/userdata)
special://profile (the current profiles’ userdata folder, usually special://masterprofile/profiles/<profilename>)
special://temp (a temporary cache folder, such as /tmp/xbmc on *nix)
when referring to the scripts folder, use os.getcwd()
nixa Wrote:Just to clear the air, if you want to have subtitle + streaming from internet, get the instructions i mentioned earlier. To be noted, this modification is meant to set the InfoLabel (file name) as the 'search keywords' in the opensubtitles.org instead of using file name & hash (the original script).
The main reason we need InfoLabel for streaming is that conventionally all movie files on the server side (the video providers) are named with random numbers mixed with alphabets. Thus, the searching process for the subtitles would fail as it would use this 'random numbers keywords'.
However, using InfoLabel as the 'keywords' not necessarily breaks the functionality of searching subtitles for local streaming files. It only removes the search by hash, thus resulting in slightly lower accuracy result.
Sorry again Amit for confusing your fans here. I will closed my case for now. Lets concentrate on the original purpose of your script.
Amet Wrote:No problems ,
just to clarify, I have no problem with change that you mention earlier. The problem comes in when the zip file of a subtitle is downloaded it gets downloaded to the path that we provided with xbmc.Player().getPlayingFile() function.
If you just put xbmc.getInfoLabel("listitem.filename"), which returns just name and no path, the downloader has no path to download the zip.
look under "def download_subtitles(self, pos):" in gui.py
local_path = os.path.dirname (self.file_original_path) should return path of the movie. self.file_original_path ( "def set_filepath( self, path ):") is search_path we set in Default.py.
After you change it to just "xbmc.getInfoLabel("listitem.filename")" , local_path becomes just a name of the movie that you see on a screen and we need the path to be able to download the subtitle.
I hope this clears it up, and again I dont mind the change but I think that was the reason Meez had problems.
Zeljko
blittan Wrote:just check the filename for a valid path, if not download it to temp directory ?
Quote:so if the script is put in users folder it should be "special://home/scripts/", correct?
if I put the script in "special://xbmc/scripts/" and update XBMC via Luncher the script will get deleted and if it resides in users folder it will be there after update,right?
Thanks a lot for clarifying this
Zeljko
nixa Wrote:Thanks. Yes, if you changed as i suggested, the subtitle download path would be in Macintosh HD/Applications for Mac or ~/Volumes/Osboot/Applications for ATV. Since we are streaming from internet, virtually there is no need to put your subs and movie files in the same location.
18:29:26 M: 20258816 DEBUG: CApplication::OnMessage : Translating RunScript(special://home/scripts/OpenSubtitles_OSD/default.py, [TV]$INFO[VideoPlayer.Season] $INFO[VideoPlayer.Episode] $INFO[VideoPlayer.TVshowtitle][/TV])
18:29:26 M: 20258816 DEBUG: CApplication::OnMessage : To RunScript(special://home/scripts/OpenSubtitles_OSD/default.py, [TV]2 11 Smallville[/TV])
18:29:26 M: 20258816 INFO: initializing python engine.
18:29:26 M: 20258816 DEBUG: LoadLibraryA('python24.dll')
18:29:26 M: 19136512 DEBUG: LoadLibrary('python24.dll') returning: 00F5B380
18:29:26 M: 19136512 DEBUG: dllGetProcAddress(0083A8E8(kernel32.dll), 'InterlockedCompareExchange') => 000D5A34
18:29:26 M: 18870272 DEBUG: GetModuleFileNameA(00000000, 1E102490, 256) => 'xbmc.xbe'
18:29:26 M: 18870272 DEBUG: advapi32.dll fake function RegQueryInfoKeyA called
18:29:26 M: 18870272 DEBUG: advapi32.dll fake function RegQueryInfoKeyA called
18:29:26 M: 18812928 DEBUG: LoadLibraryExA called with flags:
- LOAD_WITH_ALTERED_SEARCH_PATH
18:29:26 M: 18812928 DEBUG: LoadLibraryA('zlib.pyd')
18:29:26 M: 18743296 DEBUG: kernel32.dll fake function DisableThreadLibraryCalls called
18:29:26 M: 18743296 DEBUG: LoadLibrary('zlib.pyd') returning: 0089B440
18:29:26 M: 18743296 DEBUG: dllGetProcAddress(1E1B0000(zlib.pyd), 'initzlib') => 1E1B2150
18:29:26 M: 17887232 NOTICE: -->Python Initialized<--
18:29:26 M: 17887232 DEBUG: new python thread created. id=4
18:29:26 M: 17362944 DEBUG: Python thread: start processing
18:29:26 M: 17362944 DEBUG: XBPyThread::Process - The source file to load is special://home/scripts/OpenSubtitles_OSD/default.py
18:29:26 M: 17375232 DEBUG: XBPyThread::Process - Setting the Python path to Q:\scripts\OpenSubtitles_OSD;Q:\system\python\python24.zlib;Q:\system\python\DLLs;Q:\system\python\Lib;Q:\system\python\spyce
18:29:26 M: 17375232 DEBUG: XBPyThread::Process - Entering source directory Q:\scripts\OpenSubtitles_OSD
18:29:27 M: 16023552 DEBUG: kernel32.dll fake function SetConsoleCtrlHandler called
18:29:27 M: 16003072 DEBUG: LoadLibraryExA called with flags:
- LOAD_WITH_ALTERED_SEARCH_PATH
18:29:27 M: 16003072 DEBUG: LoadLibraryA('pyexpat.pyd')
18:29:27 M: 15863808 DEBUG: kernel32.dll fake function DisableThreadLibraryCalls called
18:29:27 M: 15863808 DEBUG: LoadLibrary('pyexpat.pyd') returning: 00AB33B0
18:29:27 M: 15863808 DEBUG: dllGetProcAddress(1D100000(pyexpat.pyd), 'initpyexpat') => 1D102350
18:29:28 M: 15798272 DEBUG: dllGetProcAddress(0083B170(advapi32.dll), 'CryptAcquireContextA') => 0024BC1E
18:29:28 M: 15798272 DEBUG: dllGetProcAddress(0083B170(advapi32.dll), 'CryptGenRandom') => 0024906B
18:29:28 M: 15798272 DEBUG: advapi32.dll fake function dllCryptAcquireContext() called
18:29:28 M: 15798272 DEBUG: LoadLibraryExA called with flags:
- LOAD_WITH_ALTERED_SEARCH_PATH
18:29:28 M: 15798272 DEBUG: LoadLibraryA('_socket.pyd')
18:29:28 M: 15749120 DEBUG: kernel32.dll fake function DisableThreadLibraryCalls called
18:29:28 M: 15749120 DEBUG: LoadLibrary('_socket.pyd') returning: 00F8D6A0
18:29:28 M: 15749120 DEBUG: dllGetProcAddress(1E1D0000(_socket.pyd), 'init_socket') => 1E1D4BF0
18:29:28 M: 15724544 DEBUG: LoadLibraryExA called with flags:
- LOAD_WITH_ALTERED_SEARCH_PATH
18:29:28 M: 15724544 DEBUG: LoadLibraryA('_ssl.pyd')
18:29:28 M: 15228928 DEBUG: kernel32.dll fake function DisableThreadLibraryCalls called
18:29:28 M: 15228928 DEBUG: LoadLibrary('_ssl.pyd') returning: 00E3D5E0
18:29:28 M: 15228928 DEBUG: dllGetProcAddress(02520000(_ssl.pyd), 'init_ssl') => 02521820
18:29:28 M: 14585856 NOTICE: Traceback (most recent call last):
18:29:28 M: 14585856 NOTICE: File "Q:\scripts\OpenSubtitles_OSD\default.py", line 47, in ?
18:29:28 M: 14585856 NOTICE: un.extract( zip_file, mediafolder )
18:29:28 M: 14573568 NOTICE: File "Q:\scripts\OpenSubtitles_OSD\resources\lib\unzip.py", line 34, in extract
18:29:28 M: 14573568 NOTICE: os.mkdir(dir)
18:29:28 M: 14573568 NOTICE: OSError
18:29:28 M: 14573568 NOTICE: :
18:29:28 M: 14573568 NOTICE: [Errno 2] No such file or directory: 'special://home/scripts/OpenSubtitles_OSD\\resources\\skins\\MediaStream Redux Mod\\media'
18:29:28 M: 14573568 DEBUG: msg: FFRW:normal play
18:29:28 M: 14573568 ERROR: Scriptresult: Error
18:29:28 M: 14573568 INFO: Loading skin file: DialogOK.xml
18:29:28 M: 14573568 DEBUG: Load DialogOK.xml: 37.35ms
18:29:28 M: 14573568 DEBUG: ------ Window Init (DialogOK.xml) ------
18:29:28 M: 14573568 DEBUG: Alloc resources: 0.12ms (0.00 ms skin load, 0.00 ms preload)
18:29:28 M: 14307328 DEBUG: ------ Window Deinit (DialogSeekBar.xml) ------
18:29:31 M: 14458880 DEBUG: CApplication::OnKey: 11 pressed, action is 7
18:29:32 M: 14446592 DEBUG: ------ Window Deinit (DialogOK.xml) ------
18:29:32 M: 14712832 INFO: Python script stopped
18:29:32 M: 15237120 DEBUG: python thread 4 destructed
18:29:32 M: 15237120 INFO: Python, unloading python24.dll because no scripts are running anymore
18:29:32 M: 15589376 DEBUG: Q:\system\python\DLLs\_ssl.pyd (base 02520000): Detected memory leaks: 1647 leaks
18:29:32 M: 15601664 DEBUG: leak caller address 0252489B, size 20064, counter 1645
18:29:32 M: 15601664 DEBUG: leak caller address 025248B0, size 4224, counter 2
18:29:32 M: 15601664 DEBUG: _ssl.pyd: Total bytes leaked: 24288
18:29:32 M: 16121856 DEBUG: Q:\system\python\python24.dll (base 1E000000): Detected memory leaks: 407 leaks
18:29:32 M: 19193856 DEBUG: leak caller address 1E0211CB, size 24, counter 1
18:29:32 M: 19193856 DEBUG: leak caller address 1E046F57, size 479232, counter 75
18:29:32 M: 19193856 DEBUG: leak caller address 1E04FF6B, size 1000, counter 1
18:29:32 M: 19193856 DEBUG: leak caller address 1E058C2C, size 233, counter 1
18:29:32 M: 19193856 DEBUG: leak caller address 1E05CDDB, size 33592, counter 34
18:29:32 M: 19193856 DEBUG: leak caller address 1E05E5EF, size 1976, counter 2
18:29:32 M: 19193856 DEBUG: leak caller address 1E060EA5, size 456, counter 12
18:29:32 M: 19193856 DEBUG: leak caller address 1E060F81, size 80, counter 4
18:29:32 M: 19193856 DEBUG: leak caller address 1E072C5F, size 2621440, counter 10
18:29:32 M: 19193856 DEBUG: leak caller address 1E072CAC, size 64, counter 1
18:29:32 M: 19193856 DEBUG: leak caller address 1E072E88, size 47730, counter 79
18:29:32 M: 19193856 DEBUG: leak caller address 1E072FC9, size 6303, counter 178
18:29:32 M: 19193856 DEBUG: leak caller address 1E091E3F, size 640, counter 3
18:29:32 M: 19193856 DEBUG: leak caller address 1E093BEC, size 72, counter 6
18:29:32 M: 19193856 DEBUG: python24.dll: Total bytes leaked: 3192842
18:29:28 M: 14573568 NOTICE: [Errno 2] No such file or directory: 'special://home/scripts/OpenSubtitles_OSD\\resources\\skins\\MediaStream Redux Mod\\media'
Bram77 Wrote:I was wrong, the script was found, but returns an error. This is in my log concerning the error...
I'm running version 1.1.4 of MediaStrem Redux Mod with the latest SVN version of XBMC for the XBOX.
I've updated to the latest version of the script and skin files.
Code:18:29:26 M: 20258816 DEBUG: CApplication::OnMessage : Translating RunScript(special://home/scripts/OpenSubtitles_OSD/default.py, [TV]$INFO[VideoPlayer.Season] $INFO[VideoPlayer.Episode] $INFO[VideoPlayer.TVshowtitle][/TV])
18:29:26 M: 20258816 DEBUG: CApplication::OnMessage : To RunScript(special://home/scripts/OpenSubtitles_OSD/default.py, [TV]2 11 Smallville[/TV])
18:29:26 M: 20258816 INFO: initializing python engine.
18:29:26 M: 20258816 DEBUG: LoadLibraryA('python24.dll')
18:29:26 M: 19136512 DEBUG: LoadLibrary('python24.dll') returning: 00F5B380
18:29:26 M: 19136512 DEBUG: dllGetProcAddress(0083A8E8(kernel32.dll), 'InterlockedCompareExchange') => 000D5A34
18:29:26 M: 18870272 DEBUG: GetModuleFileNameA(00000000, 1E102490, 256) => 'xbmc.xbe'
18:29:26 M: 18870272 DEBUG: advapi32.dll fake function RegQueryInfoKeyA called
18:29:26 M: 18870272 DEBUG: advapi32.dll fake function RegQueryInfoKeyA called
18:29:26 M: 18812928 DEBUG: LoadLibraryExA called with flags:
- LOAD_WITH_ALTERED_SEARCH_PATH
18:29:26 M: 18812928 DEBUG: LoadLibraryA('zlib.pyd')
18:29:26 M: 18743296 DEBUG: kernel32.dll fake function DisableThreadLibraryCalls called
18:29:26 M: 18743296 DEBUG: LoadLibrary('zlib.pyd') returning: 0089B440
18:29:26 M: 18743296 DEBUG: dllGetProcAddress(1E1B0000(zlib.pyd), 'initzlib') => 1E1B2150
18:29:26 M: 17887232 NOTICE: -->Python Initialized<--
18:29:26 M: 17887232 DEBUG: new python thread created. id=4
18:29:26 M: 17362944 DEBUG: Python thread: start processing
18:29:26 M: 17362944 DEBUG: XBPyThread::Process - The source file to load is special://home/scripts/OpenSubtitles_OSD/default.py
18:29:26 M: 17375232 DEBUG: XBPyThread::Process - Setting the Python path to Q:\scripts\OpenSubtitles_OSD;Q:\system\python\python24.zlib;Q:\system\python\DLLs;Q:\system\python\Lib;Q:\system\python\spyce
18:29:26 M: 17375232 DEBUG: XBPyThread::Process - Entering source directory Q:\scripts\OpenSubtitles_OSD
18:29:27 M: 16023552 DEBUG: kernel32.dll fake function SetConsoleCtrlHandler called
18:29:27 M: 16003072 DEBUG: LoadLibraryExA called with flags:
- LOAD_WITH_ALTERED_SEARCH_PATH
18:29:27 M: 16003072 DEBUG: LoadLibraryA('pyexpat.pyd')
18:29:27 M: 15863808 DEBUG: kernel32.dll fake function DisableThreadLibraryCalls called
18:29:27 M: 15863808 DEBUG: LoadLibrary('pyexpat.pyd') returning: 00AB33B0
18:29:27 M: 15863808 DEBUG: dllGetProcAddress(1D100000(pyexpat.pyd), 'initpyexpat') => 1D102350
18:29:28 M: 15798272 DEBUG: dllGetProcAddress(0083B170(advapi32.dll), 'CryptAcquireContextA') => 0024BC1E
18:29:28 M: 15798272 DEBUG: dllGetProcAddress(0083B170(advapi32.dll), 'CryptGenRandom') => 0024906B
18:29:28 M: 15798272 DEBUG: advapi32.dll fake function dllCryptAcquireContext() called
18:29:28 M: 15798272 DEBUG: LoadLibraryExA called with flags:
- LOAD_WITH_ALTERED_SEARCH_PATH
18:29:28 M: 15798272 DEBUG: LoadLibraryA('_socket.pyd')
18:29:28 M: 15749120 DEBUG: kernel32.dll fake function DisableThreadLibraryCalls called
18:29:28 M: 15749120 DEBUG: LoadLibrary('_socket.pyd') returning: 00F8D6A0
18:29:28 M: 15749120 DEBUG: dllGetProcAddress(1E1D0000(_socket.pyd), 'init_socket') => 1E1D4BF0
18:29:28 M: 15724544 DEBUG: LoadLibraryExA called with flags:
- LOAD_WITH_ALTERED_SEARCH_PATH
18:29:28 M: 15724544 DEBUG: LoadLibraryA('_ssl.pyd')
18:29:28 M: 15228928 DEBUG: kernel32.dll fake function DisableThreadLibraryCalls called
18:29:28 M: 15228928 DEBUG: LoadLibrary('_ssl.pyd') returning: 00E3D5E0
18:29:28 M: 15228928 DEBUG: dllGetProcAddress(02520000(_ssl.pyd), 'init_ssl') => 02521820
18:29:28 M: 14585856 NOTICE: Traceback (most recent call last):
18:29:28 M: 14585856 NOTICE: File "Q:\scripts\OpenSubtitles_OSD\default.py", line 47, in ?
18:29:28 M: 14585856 NOTICE: un.extract( zip_file, mediafolder )
18:29:28 M: 14573568 NOTICE: File "Q:\scripts\OpenSubtitles_OSD\resources\lib\unzip.py", line 34, in extract
18:29:28 M: 14573568 NOTICE: os.mkdir(dir)
18:29:28 M: 14573568 NOTICE: OSError
18:29:28 M: 14573568 NOTICE: :
18:29:28 M: 14573568 NOTICE: [Errno 2] No such file or directory: 'special://home/scripts/OpenSubtitles_OSD\\resources\\skins\\MediaStream Redux Mod\\media'
18:29:28 M: 14573568 DEBUG: msg: FFRW:normal play
18:29:28 M: 14573568 ERROR: Scriptresult: Error
18:29:28 M: 14573568 INFO: Loading skin file: DialogOK.xml
18:29:28 M: 14573568 DEBUG: Load DialogOK.xml: 37.35ms
18:29:28 M: 14573568 DEBUG: ------ Window Init (DialogOK.xml) ------
18:29:28 M: 14573568 DEBUG: Alloc resources: 0.12ms (0.00 ms skin load, 0.00 ms preload)
18:29:28 M: 14307328 DEBUG: ------ Window Deinit (DialogSeekBar.xml) ------
18:29:31 M: 14458880 DEBUG: CApplication::OnKey: 11 pressed, action is 7
18:29:32 M: 14446592 DEBUG: ------ Window Deinit (DialogOK.xml) ------
18:29:32 M: 14712832 INFO: Python script stopped
18:29:32 M: 15237120 DEBUG: python thread 4 destructed
18:29:32 M: 15237120 INFO: Python, unloading python24.dll because no scripts are running anymore
18:29:32 M: 15589376 DEBUG: Q:\system\python\DLLs\_ssl.pyd (base 02520000): Detected memory leaks: 1647 leaks
18:29:32 M: 15601664 DEBUG: leak caller address 0252489B, size 20064, counter 1645
18:29:32 M: 15601664 DEBUG: leak caller address 025248B0, size 4224, counter 2
18:29:32 M: 15601664 DEBUG: _ssl.pyd: Total bytes leaked: 24288
18:29:32 M: 16121856 DEBUG: Q:\system\python\python24.dll (base 1E000000): Detected memory leaks: 407 leaks
18:29:32 M: 19193856 DEBUG: leak caller address 1E0211CB, size 24, counter 1
18:29:32 M: 19193856 DEBUG: leak caller address 1E046F57, size 479232, counter 75
18:29:32 M: 19193856 DEBUG: leak caller address 1E04FF6B, size 1000, counter 1
18:29:32 M: 19193856 DEBUG: leak caller address 1E058C2C, size 233, counter 1
18:29:32 M: 19193856 DEBUG: leak caller address 1E05CDDB, size 33592, counter 34
18:29:32 M: 19193856 DEBUG: leak caller address 1E05E5EF, size 1976, counter 2
18:29:32 M: 19193856 DEBUG: leak caller address 1E060EA5, size 456, counter 12
18:29:32 M: 19193856 DEBUG: leak caller address 1E060F81, size 80, counter 4
18:29:32 M: 19193856 DEBUG: leak caller address 1E072C5F, size 2621440, counter 10
18:29:32 M: 19193856 DEBUG: leak caller address 1E072CAC, size 64, counter 1
18:29:32 M: 19193856 DEBUG: leak caller address 1E072E88, size 47730, counter 79
18:29:32 M: 19193856 DEBUG: leak caller address 1E072FC9, size 6303, counter 178
18:29:32 M: 19193856 DEBUG: leak caller address 1E091E3F, size 640, counter 3
18:29:32 M: 19193856 DEBUG: leak caller address 1E093BEC, size 72, counter 6
18:29:32 M: 19193856 DEBUG: python24.dll: Total bytes leaked: 3192842
I'm guessing this path isn't correct...? Or does it have something to do with the fact that I'm running MediaStream Redux Mod instead of MediaStream Redux.
Code:18:29:28 M: 14573568 NOTICE: [Errno 2] No such file or directory: 'special://home/scripts/OpenSubtitles_OSD\\resources\\skins\\MediaStream Redux Mod\\media'