0 purchases
pyAniSort 1.0.4
pyAniSort=========pyAniSort is a command line utility that will sort and rename animevideo files into folders separated by the name of the series.I made this as a way to practice python. Filename matching is not the most accurate and it will overwrite existing files without asking for confirmation. I plan on rewriting the program eventually so I will not be doing any more updates.Usage-----| There are two different commands that pyAnisort has:| The first being ``sort``| And the second ``undo``The sort command~~~~~~~~~~~~~~~~The sort command requires two arguments the from directory and the todirectory| The verify option will check the CRC's of the files before and aftersorting to verify file integrity| ``-v, --verify`` Will compare the crc's of the file before and afterthe move| The copy option will copy files rather than move them. Copied fileswill not be reflected in the history csv file| ``-c, --copy`` Will copy files instead of move them(history.csv willnot be updated)| The silent option turns off any parts of the script that would ask foruser input| ``-s, --silent`` Turn off console interactivity| The history argument takes the name of a csv file that will store therenaming history| ``--history FILE`` changes where to save history file ('history.csv'is the default)``pyAniSortsort′from/directory″to/directory′−s−−historyhistory.csv‘‘Theprogramwillsortthis:::|−−FromFolder/||[SubGroupA]SeriesName−01[ABCD1234].mkv||[SubGroupA]SeriesName−02[ABCD1234].mkv||[SubGroupA]SeriesName−03[ABCD1234].mkv||[SubGroupB]OtherSeriesNameEp01[ABCD1234].mkv||[SubGroupB]OtherSeriesNameEp02[ABCD1234].mkv||[SubGroupB]OtherSeriesNameEp03[ABCD1234].mkv||[SubGroupB]OtherSeriesNameOP[ABCD1234].mkv||[SubGroupB]OtherSeriesNameED1[ABCD1234].mkvToThis:::|−−ToFolder/||−−SeriesName/|||−−SeriesName−01−title.mkv|||−−SeriesName−02−title.mkv|||−−SeriesName−03−title.mkv||−−OtherSeriesName/|||−−OtherSeriesName−01−title.mkv|||−−OtherSeriesName−02−title.mkv|||−−OtherSeriesName−03−title.mkv|||−−OtherSeriesName−OP01.mkv|||−−OtherSeriesName−ED01.mkvTheundocommand Theundocommandwillusethehistory.csvfiletoundothesortingoperationincasetherewasanerror.Therearetworequiredpositionalargumentsthatarerequiredfortheundocommand|TheverifyoptionwillchecktheCRC′softhefilesbeforeandaftersortingtoverifyfileintegrity|‘‘−v,−−verify‘‘Willcomparethecrc′softhefilebeforeandafterthemove|Thehistoryargumenttakesthenameofacsvfilethatwillstoretherenaminghistory|‘‘−−historyFILE‘‘changeswheretosavehistoryfile(′history.csv′isthedefault)‘‘ pyanisort undo startLine endLine --history history.csv``| The first one will tell the program what line of the file to start onand the second will tell it what line to end on.| This allows better control of what files to undo| Running the following command will start undoing the files stored inhistory.csv from line 30 to line 40, or until the end of the file ifthere are less than 40 lines.| ``pyanisortundo3040‘‘|thisnextcommandwillundoallofthefilesstoredinthehistory.csvfile.|‘‘ pyanisort undo 0 0``| Both of the following commands will only undo the file at line 44 ofthe history.csv file| ``pyanisortundo4444‘‘|‘‘ pyanisort undo 44 0``After any one of these commands are used the history.csv file will bemodified to reflect the undo operation.Logs and other Important Files------------------------------| Logs and program data is stored in the following locations:| Windows: ``%APPDATA%\pyAniSort``| Linux: ``~/.pyanisort``| There are two files that are automatically created when pyAniSort isrun.| prefNames.csv and history.csv``prefNames.csv`` - Prefered show names~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| This file is for storing information about the show. This helps savetime when gathering show information multiple times.| There are three values stored in the csv file the **anime ID (aid)**,**official show name**, and the **parsed name**| The **aid** is the unique id that the anidb database uses for the show| The **official show name** is the full series name pulled from theanidb.| It is also the name that will be used when renaming and sorting thevideo files.| The **parsed name** is the name that has been pulled from the filenamebefore it was sorted.+--------+----------------------------------------------------------------------------+----------------------+| aid | Official Name | Parsed Name |+========+============================================================================+======================+| 9541 | Shingeki no Kyojin | Shingeki no Kyojin |+--------+----------------------------------------------------------------------------+----------------------+| 9787 | Ore no Nounai Sentakushi ga, Gakuen Lovecome o Zenryoku de Jama Shiteiru | NouCome |+--------+----------------------------------------------------------------------------+----------------------+This is the contents of prefNames.csv that match the table:: prefName.csv 9541,Shingeki no Kyojin,Shingeki no Kyojin 9787,"Ore no Nounai Sentakushi ga, Gakuen Lovecome o Zenryoku de Jama Shiteiru",NouCome--------------One of the useful things about putting this information in a csv filelike this is that the changes can be made to it outside of the program.| For example:| The official name of ``NouCome`` above is quite a mouthfull. It alsotakes up a lot of space and might even make new filenames run into the255 character limit on windows.| So wouldn't it be better if you could change this:| ``Ore no Nounai Sentakushi ga, Gakuen Lovecome o Zenryoku de Jama Shiteiru``| To it's shorthand name:| ``NouCome``You can do this by editing the ``prefName.csv`` file. I suggest using astandard text editor than Excel. Excel might mess up the file and causea problem when the program reads it.So you would edit the ``prefName.csv`` file from::: prefName.csv 9541,Shingeki no Kyojin,Shingeki no Kyojin 9787,"Ore no Nounai Sentakushi ga, Gakuen Lovecome o Zenryoku de Jama Shiteiru",NouComeTo this::: prefName.csv 9541,Shingeki no Kyojin,Shingeki no Kyojin 9787,"NouCome",NouComeNow when the program goes to rename your files it will use ``NouCome``instead of``Ore no Nounai Sentakushi ga, Gakuen Lovecome o Zenryoku de Jama Shiteiru````history.csv`` - File rename history~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~There are two columns in the history.csv file. The first refers to theoriginal location of a video file and the second refers to the sortedlocation+----------------------------------------------------------------------+--------------------------------------------------------------------+| Original Name | Sorted Name |+======================================================================+====================================================================+| D:\test\_files[Sub Group A] Series Name - 01 [ABCD1234].mkv | D:\Anime\Series Name\Series Name - 01 - title.mkv |+----------------------------------------------------------------------+--------------------------------------------------------------------+| D:\test\_files[Sub Group B] Other Series Name Ep01 [ABCD1234].mkv | D:\Anime\Other Series Name\Other Series Name - 01 - title.mkv |+----------------------------------------------------------------------+--------------------------------------------------------------------+This is an example ot the contents of history.csv useing real filenames:: history.csv D:\test_files\[EveTaku] Shingeki no Kyojin - 25 (1280x720 x264-Hi10P AAC)[783716E5].mkv,D:\Anime\Shingeki no Kyojin\Shingeki no Kyojin - 25 - The Wall Raid on Stohess District (3).mkv D:\test_files\[Irrational Typesetting Wizardry] NouCome - 01 [F87C6CC0].mkv,"D:\Anime\Ore no Nounai Sentakushi ga, Gakuen Lovecome o Zenryoku de Jama Shiteiru\Ore no Nounai Sentakushi ga, Gakuen Lovecome o Zenryoku de Jama Shiteiru - 01 - That Choice Put My Life in Motion.mkv"Installation------------| Link to PyPI page: https://pypi.python.org/pypi/pyAniSort| There is also a windows installation binary if you don't want toinstall pip.| Make sure that you are using the python3 version of pip wheninstalling.| This program only works with python3``pipinstallpyanisort‘‘|Ifyoudon′thavepipinstalledyoucanrunthesecommandsfromtheterminaltogetit|‘‘ sudo curl http://python-distribute.org/distribute_setup.py | python3``| ``$ sudo curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python3``Possible Errors---------------There are a few possible errors that may occur when running this scriptBanned''''''``0000-00-00 00:00:00,000 - pyanisort.findtitle - ERROR - findtitle : 62 - Error parsing through cache\0000.xml.gz: Banned``| This means that the anidb.net server has gotten too many requests fromthe machines IP address.| It will refuse any more connections for the next couple hours.This is a security measure put in place by the server and I have notfound any other method of getting around it other than by waiting acouple hours to run the script againContact Me----------Questions or comments about ``pyAniSort``? send me an email at`[email protected] <mailto:[email protected]>`__.pyAniSort 1.0.3 (February 23, 2014)------------------------------------ Added an option to compare CRC's of files before and after they are sorted to verify integrity of file transfers- An option that has the program copy files rather than move them. copied files are not reflected in the history file- Will now detect if the file is an opening or ending song and will rename it accordingly- Will save a file with traceback if an unexpected error occurspyAniSort 1.0.2 (February 11, 2014)------------------------------------ Program files are now created and saved to ~/.pyanisort on Linux and %APPDATA%\pyAniSort on windows- Short pause between downloads of series xml files. this will help prevent temp bans - February 12, 2014- Fixed bugs with program data creation on Linux - February 12, 2014pyAniSort 1.0.1 (February 09, 2014)------------------------------------ Restructured program so that it could be downloaded and installed through the Python Package Index- Created setup.py and init.py- Program now changes working directory to program location to use data files stored therepyAniSort 1.0.0 (February 06, 2014)------------------------------------ Initial upload
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.