chenqingyu / auto-sub

Automatically exported from code.google.com/p/auto-sub
0 stars 0 forks source link

Add moving files to ExamplePostProcess #49

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Support moving files to another location when (Dutch) subtitle is downloaded.

Original issue reported on code.google.com by basroi...@gmail.com on 17 Feb 2012 at 1:20

GoogleCodeExporter commented 9 years ago
I like to see this feature being added to ExamplePostProcess

Original comment by romke.va...@gmail.com on 17 Feb 2012 at 1:23

GoogleCodeExporter commented 9 years ago
That should be the first step.
Maybe later it can be integrated so that the series that should be moved can be 
edited in the interface

Original comment by basroi...@gmail.com on 17 Feb 2012 at 1:29

GoogleCodeExporter commented 9 years ago
Agree!

Original comment by romke.va...@gmail.com on 17 Feb 2012 at 1:30

GoogleCodeExporter commented 9 years ago

Original comment by romke.va...@gmail.com on 19 Feb 2012 at 3:07

GoogleCodeExporter commented 9 years ago

Original comment by romke.va...@gmail.com on 19 Feb 2012 at 5:58

GoogleCodeExporter commented 9 years ago
In the attachment the code I currently use.
It's not pretty, but gets the job done.

It needs a good cleanup to make it work for everybody (currently for personal 
use only).

Original comment by basroi...@gmail.com on 1 Mar 2012 at 12:18

Attachments:

GoogleCodeExporter commented 9 years ago
Hello, i'm a real noob in programming so how can I run this script to let it 
work:)?

Original comment by ivop...@gmail.com on 1 Mar 2012 at 2:54

GoogleCodeExporter commented 9 years ago
This is just a script uploaded by basroijen to give us an idea how we can 
implement this features. So we don't support it. Please hold on till this is 
implemented in Auto-Sub. Feel free to ask basroijen for help on the bierdopje 
forum (his forum name is: bad_my84). 

On-Topic: Bas, this does not support season folders, any idea how we can 
implement this? We can use the reg expression used in the helper module. Or do 
you have a easier fix?

Original comment by romke.va...@gmail.com on 1 Mar 2012 at 3:27

GoogleCodeExporter commented 9 years ago
Ahh, thanks for the answer, i'm glad you guys are working on it.

Original comment by ivop...@gmail.com on 1 Mar 2012 at 3:58

GoogleCodeExporter commented 9 years ago
Same crappy code, but now integrated into ExamplePostProcess.
These setting need to be ajusted to make it work:
- move: set to True to enable file moving
- rootpath: where your series are located now
- destpath: where your should be moved to
- serieList: series that should be moved

Original comment by basroi...@gmail.com on 16 Mar 2012 at 6:33

GoogleCodeExporter commented 9 years ago
thanks for the answer, but where can i find the files?

Original comment by ivop...@gmail.com on 16 Mar 2012 at 7:34

GoogleCodeExporter commented 9 years ago
Haha, sorry, forgot to include the file :s

Original comment by basroi...@gmail.com on 16 Mar 2012 at 8:53

Attachments:

GoogleCodeExporter commented 9 years ago
doesn't matter, glad you uploaded it anyway:)

Original comment by ivop...@gmail.com on 16 Mar 2012 at 8:59

GoogleCodeExporter commented 9 years ago
How do i implent the ExamplePostProcess.py in autosub ?

and isn't it possible to manual edit the py script and add seizoen XX per serie 
?

Original comment by mailvm...@gmail.com on 20 Mar 2012 at 4:01

GoogleCodeExporter commented 9 years ago
Go to config in the webinterface and set "Postprocesscmd" to "python 
ExampleProcess.py" (in Linux at least)

Original comment by basroi...@gmail.com on 21 Mar 2012 at 8:32

GoogleCodeExporter commented 9 years ago
Updated the moving part, should now work in Windows too (untested) and added 
new options:
- Move all episodes instead of only series in a list
- Create season folders in the destination dir
- Create episode folders in the destination dir

Original comment by basroi...@gmail.com on 21 Mar 2012 at 8:47

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Bas, I get the following error when i run you're script

2012-03-26 20:17:47,789 INFO  downloadSubs: DOWNLOADED: 
S:\Process\DirForSub\Awake\Season 01\Awake.S01E04.720p.HDTV.X264-DIMENSION.srt
2012-03-26 20:17:47,789 INFO  downloadSubs: Running PostProcess
2012-03-26 20:17:48,039 ERROR  downloadSubs: PostProcess: Traceback (most 
recent call last):
  File "C:\Program Files (x86)\AutoSub\ExamplePostProcess.py", line 9, in <module>
    import autosub.Helpers
ImportError: No module named autosub.Helpers

I'm running Windows Server 2008 R2 with autosub 5.3

Original comment by ivop...@gmail.com on 26 Mar 2012 at 6:23

GoogleCodeExporter commented 9 years ago
Yeah, I noticed the same issue. 
That is why his version is not officially supported yet. 
Also, the version attached in this issue is not working correctly for windows 
(even if you supply the correct modules by hand). 

Original comment by romke.va...@gmail.com on 28 Mar 2012 at 9:35

GoogleCodeExporter commented 9 years ago
Hi,
My intention was to give bas the error so when he had time, he could look at it 
and maybe make the script compatible for windows. But i will post the error on 
bierdopje as well.

Thanks for the answer:)

Original comment by ivop...@gmail.com on 28 Mar 2012 at 9:40

GoogleCodeExporter commented 9 years ago
With my last commits I made the postprocess example compatible for windows 
(just notifications like emial, growl and twitter. But it is the base need for 
supporting moving files). And you are here at the correct place for discussing 
this issue :)

Just hang on and wait for bas to get back on this issue(I have send him an 
email and waiting for his respones).

Original comment by romke.va...@gmail.com on 28 Mar 2012 at 9:48

GoogleCodeExporter commented 9 years ago
Ah thanks for that:)

Original comment by ivop...@gmail.com on 28 Mar 2012 at 9:51

GoogleCodeExporter commented 9 years ago
Issue 78 has been merged into this issue.

Original comment by romke.va...@gmail.com on 6 Apr 2012 at 12:40

GoogleCodeExporter commented 9 years ago
Could is also be possible to add renaming to it? 

Original comment by romke.va...@gmail.com on 6 Apr 2012 at 12:42

GoogleCodeExporter commented 9 years ago
Dear Bas,

I have tried your last ExamplePostProcess on a Windows 7 pc and I am getting 
the following error:

2012-04-08 23:55:51,719 ERROR  downloadSubs: PostProcess: Traceback (most 
recent call last):

  File "Z:\AutoSub 0.5.3 Alpha Windows\MoveFiles.py", line 312, in <module>

    moving(sys.argv[1])

  File "Z:\AutoSub 0.5.3 Alpha Windows\MoveFiles.py", line 262, in moving

    moveEpisode(message)

  File "Z:\AutoSub 0.5.3 Alpha Windows\MoveFiles.py", line 215, in moveEpisode

    filenameResults = autosub.Helpers.ProcessFileName(os.path.splitext(messageParts[-1])[0], os.path.splitext(messageParts[-1])[1])

NameError: global name 'autosub' is not defined

In the Windows version of autosub, the autosub.helpers module is in the 
AutoSub.exe I think. Is there a way to solve this in the current version or is 
this something for AutoSub 2.0.

Original comment by maxim.du...@gmail.com on 8 Apr 2012 at 10:02

GoogleCodeExporter commented 9 years ago
Workaround:
Go to the download section, download the non windows version. Extract it, 
search for Helper.py (it should be in the folder: autosub)
Create a folder autosub in the same folder as your MoveFiles.py
Place Helpers.py in autosub
So you should get the following (depends on the location of the files ofc):

C:\MoveFile.py
C:\autosub\Helpers.py

Hopes it helps

Original comment by romke.va...@gmail.com on 9 Apr 2012 at 10:16

GoogleCodeExporter commented 9 years ago
Dear Romke,

Thanks for the workaround, but it is still not working. I am running Alpha 
0.5.3 of the non windows version (it appears this is running when there was a 
problem in the past, nice job, but will go back to the Windows version for 
running in the back ground) and I am getting the following error for moving the 
files:

2012-04-09 15:32:56,809 ERROR  downloadSubs: PostProcess: Traceback (most 
recent call last):

  File "Z:\AutoSub 0.5.3 Alpha\auto-sub\MoveFiles.py", line 314, in <module>

    moving(sys.argv[1])

  File "Z:\AutoSub 0.5.3 Alpha\auto-sub\MoveFiles.py", line 264, in moving

    moveEpisode(message)

  File "Z:\AutoSub 0.5.3 Alpha\auto-sub\MoveFiles.py", line 217, in moveEpisode

    filenameResults = autosub.Helpers.ProcessFileName(os.path.splitext(messageParts[-1])[0], os.path.splitext(messageParts[-1])[1])

AttributeError: 'module' object has no attribute 'Helpers'

Any suggestions? I tried to put in Helpers into the folder as suggested, but it 
does not work, he is also asking for version and other things.

Original comment by maxim.du...@gmail.com on 9 Apr 2012 at 1:39

GoogleCodeExporter commented 9 years ago
Sorry for the delay, but my 'free' time has been limited atm.
The included file has a working moving function in both Windows and Linux.

Known issues:
- Windows users should use double backslashes or a forward slash in stead of a 
single backslash in the destpath. If this is not honored it errors out with an 
error.
- Caption matters in the destination path, so 'season 1' is NOT equal to 
'Season 1'. Not sure how this impacts Windows users.

Original comment by basroi...@gmail.com on 9 Apr 2012 at 7:06

Attachments:

GoogleCodeExporter commented 9 years ago
Dear Bas,

I am getting the following error in Windows 7:

2012-04-10 06:10:23,413 ERROR  downloadSubs: PostProcess: Traceback (most 
recent call last):

  File "Z:\AutoSub 0.5.3 Alpha Windows\MoveFiles.py", line 395, in <module>

    moving(sys.argv[1])

  File "Z:\AutoSub 0.5.3 Alpha Windows\MoveFiles.py", line 345, in moving

    moveEpisode(message)

  File "Z:\AutoSub 0.5.3 Alpha Windows\MoveFiles.py", line 303, in moveEpisode

    checkDir(dst)

  File "Z:\AutoSub 0.5.3 Alpha Windows\MoveFiles.py", line 271, in checkDir

    print "postProcess.checkDir: while tying to create %s (destdir), we got the following error: %s" % dirs, e.errno

TypeError: not enough arguments for format string

I only filled in true in move and moveall

Original comment by maxim.du...@gmail.com on 10 Apr 2012 at 4:13

GoogleCodeExporter commented 9 years ago
Issue closed, because I will not implement this.

Original comment by romke.va...@gmail.com on 4 Oct 2012 at 1:45