[SOLVED] Subitles Download

Get help with Sick Beard and report/discuss bugs

Re: [SOLVED] Subitles Download

Postby Methanoid » Tue Apr 17, 2012 9:43 am

Why 3 forks? Surely we want one, until its all working good and then put it back into the main Sickbeard program? At least thats what I would want! :D
Methanoid
 
Posts: 20
Joined: Thu Dec 16, 2010 4:24 am

Re: [SOLVED] Subitles Download

Postby rascalli » Tue Apr 17, 2012 10:25 am

IT's open source .. so people can fork as many as they want ;-)
NL newsserver starting €44,40 a year

Image

Hope you will use my refereal link
rascalli
 
Posts: 4913
Joined: Tue Aug 10, 2010 2:26 pm

Re: [SOLVED] Subitles Download

Postby Methanoid » Tue Apr 17, 2012 12:11 pm

rascalli wrote:IT's open source .. so people can fork as many as they want ;-)


i know but I'd rather Subtitle support was in Midgetspy's official SB not someone elses fork where they could have buggered up something we don't know about ;)
Methanoid
 
Posts: 20
Joined: Thu Dec 16, 2010 4:24 am

Re: [SOLVED] Subitles Download

Postby MetreM » Sun Jul 01, 2012 8:40 am

I have write a batch script for dl subtitle before to execute SabToSickbeard Processing (work only on windows 7 XXBits).
With this script you can use official branch of sickbeard and have only episode with subtitle processed in sickbeard.
For best chance use only HD TV and SD TV quality (that work 99% of time for me)

You must have python 2.7 with periscope and subliminal python extension installed
http://subliminal.readthedocs.org/en/latest/index.html
http://code.google.com/p/periscope/

SABnzbd post process Script : SabToSickBeard.cmd (Update 27/07/2012)
Code: Select all
@echo off
echo.
rem _-________________________________________________[ EDIT WITH YOUR VALUE ]________________________________________________-_
set PYTHON_HOME="C:\NAS\python27"
set SICKBEARD_HOME="C:\NAS\sickbeard"
set TEMP_DIR="%~dp0"
set TEMP_DIR="%TEMP_DIR:~1,-2%"
set LANGUAGE=fr
rem if search is in ERROR try ERROR_LOOP times with interval of ERROR_TIME second -- ERROR_TIME=0=infinite
set /A ERROR_TIME=600
set /A ERROR_LOOP=6
rem if search failed try FAILED_LOOP times with interval of FAILED_TIME second -- FAILED_TIME=0=infinite
set /A FAILED_TIME=86400
set /A FAILED_LOOP=1
rem _-__________________________________________________________[ INIT ]_________________________________________________________-_
:init
set OLD_DIR=%1
set /A CPT=0
setlocal EnableDelayedExpansion
for %%i in (!OLD_DIR!\*.*) do (
   set 32BITS_LIMITATION=%%~zi
   set /A SIZE=!32BITS_LIMITATION:~0,-3!+1
   if !SIZE! GTR !CPT! (
      set OLD_NAME="%%~ni"
      set EXT=%%~xi
      set /A CPT=!32BITS_LIMITATION:~0,-3!+1
   )
)
setlocal DisableDelayedExpansion
echo ".avi.mkv.mp4." | findstr /c:%EXT%. > nul
if not %ERRORLEVEL%==0 (
   echo [ERROR] %EXT% is not compatible
   goto :eof
)
set /A CPT=0
rem _-_______________________________________________________[ SEARCH ]_______________________________________________________-_
:search
set /A CPT=%CPT%+1
set LOG=%OLD_DIR%\\"%DATE:/=%-%TIME::=%"
%PYTHON_HOME%\python %PYTHON_HOME%\Scripts\periscope -l %LANGUAGE% --cache-folder=%TEMP_DIR% %OLD_DIR%\\%OLD_NAME%%EXT% > %LOG%-sabnzbd.log 2>&1
%PYTHON_HOME%\python %PYTHON_HOME%\Scripts\subliminal -l %LANGUAGE% --cache-dir=%TEMP_DIR% %OLD_DIR%\\%OLD_NAME%%EXT% >> %LOG%-sabnzbd.log 2>&1
if not exist %LOG%-sabnzbd.log (
   echo [ERROR] Could not find %LOG%-sabnzbd.log
   goto :eof
)
rem _-________________________________________________________[ CHECK ]________________________________________________________-_
:check
if exist %OLD_DIR%\\%OLD_NAME%.srt (
   set EXT=.srt
   goto :success
) else if exist %OLD_DIR%\\%OLD_NAME%.sub (
   set EXT=.sub
   goto :success
) else (
   findstr /I "error" %LOG%-sabnzbd.log
   if %errorlevel%==0 (goto :error)
   findstr /I "warning" %LOG%-sabnzbd.log
   if %errorlevel%==0 (goto :warning)
   goto :failed
)
rem _-_______________________________________________________[ SUCCESS ]_______________________________________________________-_
:success
move %OLD_DIR%\\%OLD_NAME%%EXT% %TEMP_DIR%\\%OLD_NAME%%EXT% > NUL
%PYTHON_HOME%\python %SICKBEARD_HOME%\autoProcessTV\sabToSickBeard.py %OLD_DIR% %2 %3 %4 %5 %6 %7
if not exist %SICKBEARD_HOME%\SickBeardToSab.log (
   echo [ERROR] Could not find %SICKBEARD_HOME%\SickBeardToSab.log
   goto :eof
)
setlocal EnableDelayedExpansion
for /F "tokens=*" %%i in ('findstr __NEW_DIR__ %SICKBEARD_HOME%\SickBeardToSab.log') do set NEW_DIR=%%i
set NEW_DIR="!NEW_DIR:~12,-2!"
for /F "tokens=*" %%i in ('findstr __NEW_NAME__ %SICKBEARD_HOME%\SickBeardToSab.log') do set NEW_NAME=%%i
set NEW_NAME="!NEW_NAME:~13,-5!"
move %TEMP_DIR%\\%OLD_NAME%%EXT% !NEW_DIR!\\!NEW_NAME!%EXT% > NUL
if not exist !NEW_DIR!\\!NEW_NAME!%EXT% (
   echo [ERROR] Move subtitle failed : Could not move %TEMP_DIR%\\%OLD_NAME%%EXT% to !NEW_DIR!\\!NEW_NAME!%EXT%
   goto :eof
)
setlocal DisableDelayedExpansion
del %SICKBEARD_HOME%\SickBeardToSab.log
echo [INFO] Subtitle found : %LANGUAGE%
goto :eof
rem _-________________________________________________________[ FAILED ]________________________________________________________-_
:failed
if %CPT%==%FAILED_LOOP% (
   echo [WARNING] No subtitle found
   goto :eof
)
call timeout /T %FAILED_TIME% /NOBREAK
goto :search
rem _-_______________________________________________________[ WARNING ]_______________________________________________________-_
:warning
echo [ERROR] No subtitle found : There is WARNING in log
goto :eof
rem _-________________________________________________________[ ERROR ]________________________________________________________-_
:error
if %CPT%==%ERROR_LOOP% (
   echo [ERROR] No subtitle found : There is ERROR in log
   goto :eof
)
call timeout /T %ERROR_TIME% /NOBREAK
goto :search
:eof

Sickbeard extra Script : SickBeardToSab.cmd (Update 25/07/2012)
Code: Select all
@echo off
for %%I in (%1) do Set FILE_DIR="%%~dpI"
for %%I in (%1) do Set FILE_NAME="%%~nxI"
echo __NEW_DIR__%FILE_DIR%>SickBeardToSab.log
echo __NEW_NAME__%FILE_NAME%>>SickBeardToSab.log
echo OK


Preview => http://www.hostingpics.net/viewer.php?id=615657Sanstitre.jpg

Please MP, if you convert that in python script or for report bug or comment :)
I wait the "re add" funtionnality (like couchpotato) for add that in my script

UPDATE 15/04/2013 => FOR LINUX
SabToSickbeard.sh
Code: Select all
#!/bin/bash
# _-________________________________________________[ EDIT WITH YOUR VALUE ]________________________________________________-_
TEMP_DIR='.'
LANGUAGE='fr'
# if search is in ERROR try ERROR_LOOP times with interval of ERROR_TIME second -- ERROR_TIME=0=infinite
ERROR_TIME=600
ERROR_LOOP=6
# if search failed try FAILED_LOOP times with interval of FAILED_TIME second -- FAILED_TIME=0=infinite
FAILED_TIME=86400
FAILED_LOOP=1
# _-__________________________________________________________[ INIT ]_________________________________________________________-_
init()
{
   CPT=0
   OLD_DIR=$1
   EXT=`ls -lS $OLD_DIR | sed ':a;N;$!ba;s/\n/ /g' | awk '{print $11}' | awk -F. '{print $NF}'`
   OLD_NAME=`ls -lS $OLD_DIR | sed ':a;N;$!ba;s/\n/ /g' | awk '{print $11}' | sed "s/.$EXT$//"`
   if [ $EXT != 'mkv' && $EXT != 'avi' && $EXT != 'mp4' ]; then
      echo "[ERROR] $EXT is not compatible"
      exit 1
   fi
   search $1 $2 $3 $4 $5 $6 $7
}
# _-_______________________________________________________[ SEARCH ]_______________________________________________________-_
search()
{
   CPT=$CPT+1
   LOG=$OLD_DIR/`date +%d%m%Y-%H%M%S%N`
   periscope -l $LANGUAGE --cache-folder=$TEMP_DIR $OLD_DIR/$OLD_NAME.$EXT > $LOG-sabnzbd.log 2>&1
   subliminal -l $LANGUAGE --cache-dir=$TEMP_DIR $OLD_DIR/$OLD_NAME.$EXT >> $LOG-sabnzbd.log 2>&1
   if [ ! -f $LOG-sabnzbd.log ]; then
      echo "[ERROR] Could not find $LOG-sabnzbd.log"
      exit 1
   fi
   check $1 $2 $3 $4 $5 $6 $7
}
# _-________________________________________________________[ CHECK ]________________________________________________________-_
check()
{
   if [ -f $OLD_DIR/$OLD_NAME.srt ]; then
      SUB='srt'
      success
   else
      if [ -f $OLD_DIR/$OLD_NAME.sub ]; then
         SUB='sub'
         sucess $1 $2 $3 $4 $5 $6 $7
      else
         grep "error" $LOG-sabnzbd.log >/dev/null; if [ $? == 0 ];then error; fi
         grep "warning" $LOG-sabnzbd.log >/dev/null; if [ $? == 0 ];then warning; fi
         failed
      fi
   fi
}
# _-_______________________________________________________[ SUCCESS ]_______________________________________________________-_
success()
{
   mv $OLD_DIR/$OLD_NAME.$SUB $TEMP_DIR/$OLD_NAME.$SUB
   python2.7 ./sabToSickBeard.py $OLD_DIR $1 $2 $3 $4 $5 $6 $7
   if [ ! -f ./SickBeardToSab.log ]; then
      echo "[ERROR] Could not find SickBeardToSab.log"
      exit 1
   fi
   NEW_DIR=`cat $LOG-sabnzbd.log | grep '__NEW_DIR__' | awk -F__NEW_DIR__ '{print $2}'`
   NEW_NAME=`cat $LOG-sabnzbd.log | grep '__NEW_NAME__' | awk -F__NEW_NAME__ '{print $2}' | sed "s/.$EXT$//"`
   mv $TEMP_DIR/$OLD_NAME.$SUB $NEW_DIR/$NEW_NAME.$SUB
   if [ ! -f $NEW_DIR/$NEW_NAME.$SUB ]; then
      echo "[ERROR] Move subtitle failed : Could not move $TEMP_DIR/$OLD_NAME.$SUB to $NEW_DIR/$NEW_NAME.$SUB"
      exit 1
   fi
   rm ./SickBeardToSab.log
   echo "[INFO] Subtitle found : $LANGUAGE"
   exit 0
}
# _-________________________________________________________[ FAILED ]________________________________________________________-_
failed()
{
   if [ $CPT == $FAILED_LOOP ]; then
      echo '[WARNING] No subtitle found'
      exit 0
   fi
   sleep $FAILED_TIME
   search
}
# _-_______________________________________________________[ WARNING ]_______________________________________________________-_
warning()
{
   echo '[ERROR] No subtitle found : There is WARNING in log'
   exit 1
}
# _-________________________________________________________[ ERROR ]________________________________________________________-_
error()
{
   if [ $CPT == $FAILED_LOOP ]; then
      echo '[ERROR] No subtitle found : There is ERROR in log'
      exit 1
   fi
   sleep $FAILED_TIME
   search
}
init $1 $2 $3 $4 $5 $6 $7
exit 1


SickbeardToSab.sh
Code: Select all
#!/bin/bash
cd $(dirname $0)
FILE_DIR=`dirname "$1"`
FILE_NAME=`basename "$1"`
echo "__NEW_DIR__$FILE_DIR">SickBeardToSab.log
echo "__NEW_NAME__$FILE_NAME">>SickBeardToSab.log
chgrp sabnzbdplus SickBeardToSab.log
echo 'OK'
Last edited by MetreM on Mon Apr 15, 2013 3:29 am, edited 1 time in total.
MetreM
 
Posts: 1
Joined: Sun Jul 01, 2012 8:32 am

Re: [SOLVED] Subitles Download

Postby kevindd992002 » Mon Nov 05, 2012 1:08 am

So right now there isn't an automatic subtitle downloader for sick beard included in its post-processing?
kevindd992002
 
Posts: 75
Joined: Sat Nov 03, 2012 8:30 pm

Re: [SOLVED] Subitles Download

Postby mr_orange » Fri Jan 18, 2013 5:42 am

Just Integrated Subliminal Subtitle support in my branch.
If anyone wanna try you can download it via git https://github.com/mr-orange/Sick-Beard.git
or via zip https://github.com/mr-orange/Sick-Beard ... ateBay.zip

Mr_Orange
mr_orange
 
Posts: 447
Joined: Wed Mar 30, 2011 4:57 am

Re: [SOLVED] Subitles Download

Postby kevindd992002 » Fri Jan 18, 2013 10:28 am

What does this actually do?
kevindd992002
 
Posts: 75
Joined: Sat Nov 03, 2012 8:30 pm

Re: [SOLVED] Subitles Download

Postby kevindd992002 » Sun Jan 20, 2013 6:10 pm

mr_orange?
kevindd992002
 
Posts: 75
Joined: Sat Nov 03, 2012 8:30 pm

Re: [SOLVED] Subitles Download

Postby mr_orange » Tue Jan 22, 2013 4:08 am

It's a Fork of sickbeard with all the features of development branch plus other feature added as extended torrent support (thepiratebay and dailytvtorrents). Have a nicer gui, new feature like personal scene exceptions, imdb integration, and other feature i do not remember, plus the subtitle management integrated in sickbeard. Try it.
mr_orange
 
Posts: 447
Joined: Wed Mar 30, 2011 4:57 am

Re: [SOLVED] Subitles Download

Postby kevindd992002 » Tue Jan 22, 2013 10:32 am

mr_orange wrote:It's a Fork of sickbeard with all the features of development branch plus other feature added as extended torrent support (thepiratebay and dailytvtorrents). Have a nicer gui, new feature like personal scene exceptions, imdb integration, and other feature i do not remember, plus the subtitle management integrated in sickbeard. Try it.


Is this an official mod of SB?
kevindd992002
 
Posts: 75
Joined: Sat Nov 03, 2012 8:30 pm

PreviousNext

Return to Support / Bug Reports

Who is online

Users browsing this forum: Bing [Bot] and 5 guests