Welcome, Guest
Python Scripts for ComicRack

TOPIC: Sharkus ComicInfo

Sharkus ComicInfo 10 years 3 weeks ago #129

  • greenlanternprime
  • greenlanternprime's Avatar
  • Offline
  • Expert Boarder
  • Me Grimlock.. Bad Ass!
  • Posts: 103
  • Karma: 10
ComicInfo.py 0.20 Release - Creates ComicInfo.xml in Comics
Here's an initial pass at an application to scrub comicbookdb.com for comic information. It is brute force, but generally works. I would classify it as early alpha, so be kind. Please reply to this thread if with any specific problems.

It's command line driven and requires Python 2.4 or 2.5, winrar, and 7zip (for injecting the ComicInfo.xml files into rar and zip files). It has been tested under both Windows and Linux. Here is the command line help:


Code:

comicinfo.py - Version 0.20 - Copyright 2007 by Sharkus

Usage: comicinfo.py [OPTIONS] PATH

File Attachment:

File Name: comicinfo_0.zip
File Size:21 KB


BACKUP YOUR FILES BEFORE USING THIS PROGRAM!

Scans all comic files (cbr/cbz/rar/zip) in specified path (recursively),
does best effort to lookup information on comicbookdb.com, and
create/inject comicinfo.xml.

This program is designed to be used with ComicRack.

Some notes regarding use of this program.

1) By default rar.exe (rar, cbr) and 7z[a].exe (zip, cbz) are used to
inject and update the ComicInfo.xml file inside the comic.
Both must be in your path or at their default install locations
C:Program FilesWinrar and C:Program Files7-Zip.
2) If you do not have rar and 7zip installed, you should use the -z option
(with significant limitations)

Options:
-o Overwrite existing ComicInfo.xml files.
-v Verbose
-f, --file= Only generate ComicInfo.xml for specified file. All other
files in the directory are ignored. This option will be
used automatically if a filename with a supported extension
is included as part of the PATH.
-t, --titleid= Specify the comicbookdb.com title id. This will be used to
match all comics in the specified path. Useful if you have
a large number of generic comics and don't want to manually
specify which is the correct match. Do not use if you have
mixed comics in the path (or below).
-i, --issueid= Specify a specific comicbookdb.com title id. This must be
used with the '-f' option to specify the comic file. This
option takes precidence over the '-t' option.
-r Recursively search subdirectories for comic files.
-u Update ComicInfo.xml using URL stored in the notes section
of a pre-existing ComicInfo.xml. Very useful if data has
been updated on comicbookcb (or if bugs have been fixed
in this program!) Overwrite is automatically enabled in
this mode.
--rename= Allows renaming and organization of comic files. Comic files
must contain a ComicInfo.xml file in order to be qualified
for the move/rename operation. Any of the fields found in
the ComicInfo.xml file can be used as part of the rename
operation. Each file must be surrounded by % (eg. %Title%).
Paths are relative to the current comic location. Filename
extensions are preserved.
-m When a comic is not found move the comic file to a 'noissue'
or 'notitle' subdirectory.
-e When multiple matches are found for a comic title eliminate
as many as possible before prompting.

Examples:

comicinfo.py -r C:Comics
This would recursively search for all comics in the c:Comics directory.
Prompts will be given if a filename matches multiple titles and issues.


comicinfo.py -t89 -o C:ComicsSpawn
This would search for all comics in the c:ComicsSpawn directory. Any that
are found would be assumed to be from an issue found on the following web page:
www.comicbookdb.com/title.php?ID=89 (Spawn). Existing ComicInfo.xml
would be overwritten. Care should be taken to ensure that ALL comics in this
directory are part of this series.


comicinfo.py -o -f\"Spawn 066.cbr\" C:ComicsSpawn
This would update the \"Swawn 066.cbr\" comic book (and prompt since multiple
matches will be found for \"Spawn\").

comicinfo.py -o -i12184 -f\"Spawn 066.cbr\" C:ComicsSpawn
This would update the \"Swawn 066.cbr\" comic book with data extracted from
www.comicbookdb.com/issue.php?ID=12184 (the page for Spawn #66).

comicinfo.py --rename=\"C:Comics%Series% (%Volume%)%Series% %Number% (%Year%)\" C:Comics
This function would rename all comics in the C:Comics directory to the specified
format.

TROUBLESHOOTING

This script should be run from the Windows/Linux command line (not python command line).
Use quotes wisely if dealing with directories that contain spaces or special characters.
Make sure the 7zip and WinRar are in your path or at the default locations.
Ensure Python is in your path.

Good luck and have fun! Special thanks to cyolito for ComicRack!
The administrator has disabled public write access.

Re:Sharkus ComicInfo 10 years 3 weeks ago #130

  • greenlanternprime
  • greenlanternprime's Avatar
  • Offline
  • Expert Boarder
  • Me Grimlock.. Bad Ass!
  • Posts: 103
  • Karma: 10
bit of a messy repost from the old forum if anyone was thinking of taking a shot at intergrating into comicrack, the script works really well and Sharkus must be applauded on his efforts (whereever he may be!)
The administrator has disabled public write access.

Re:Sharkus ComicInfo 10 years 2 weeks ago #183

  • sharkus
  • sharkus's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 3
I'm still around (just not as often). ;)

Thanks for posting the script. You can also obtain it directly from my web page (it's a free web host, so it may not be the most reliable thing in the world):

No longer available at request of comicbookdb

-Sharkus

P.S. Here is a slightly more readable command line help:

[code:1]

comicinfo.py - Version 0.20 - Copyright 2007 by Sharkus

Usage: comicinfo.py [OPTIONS] PATH BACKUP YOUR FILES BEFORE USING THIS PROGRAM! Scans all comic files (cbr/cbz/rar/zip) in specified path (recursively), does best effort to lookup information on comicbookdb.com, and create/inject comicinfo.xml. This program is designed to be used with ComicRack. Some notes regarding use of this program. 1) By default rar.exe (rar, cbr) and 7z[a].exe (zip, cbz) are used to inject and update the ComicInfo.xml file inside the comic. Both must be in your path or at their default install locations C:\\Program Files\\Winrar\\ and C:\\Program Files\\7-Zip\\. 2) If you do not have rar and 7zip installed, you should use the -z option (with significant limitations) Options: -o Overwrite existing ComicInfo.xml files. -v Verbose -f, --file= Only generate ComicInfo.xml for specified file. All other files in the directory are ignored. This option will be used automatically if a filename with a supported extension is included as part of the PATH. -t, --titleid= Specify the comicbookdb.com title id. This will be used to match all comics in the specified path. Useful if you have a large number of generic comics and don't want to manually specify which is the correct match. Do not use if you have mixed comics in the path (or below). -i, --issueid= Specify a specific comicbookdb.com title id. This must be used with the '-f' option to specify the comic file. This option takes precidence over the '-t' option. -r Recursively search subdirectories for comic files. -u Update ComicInfo.xml using URL stored in the notes section of a pre-existing ComicInfo.xml. Very useful if data has been updated on comicbookcb (or if bugs have been fixed in this program!) Overwrite is automatically enabled in this mode. --rename= Allows renaming and organization of comic files. Comic files must contain a ComicInfo.xml file in order to be qualified for the move/rename operation. Any of the fields found in the ComicInfo.xml file can be used as part of the rename operation. Each file must be surrounded by % (eg. %Title%). Paths are relative to the current comic location. Filename extensions are preserved. -m When a comic is not found move the comic file to a 'noissue' or 'notitle' subdirectory. -e When multiple matches are found for a comic title eliminate as many as possible before prompting. Examples: comicinfo.py -r C:\Comics\ -------------------------- This would recursively search for all comics in the c:\Comics\ directory. Prompts will be given if a filename matches multiple titles and issues. comicinfo.py -t89 -o C:\Comics\Spawn ------------------------------------ This would search for all comics in the c:\Comics\Spawn directory. Any that are found would be assumed to be from an issue found on the following web page: http://www.comicbookdb.com/title.php?ID=89 (Spawn). Existing ComicInfo.xml would be overwritten. Care should be taken to ensure that ALL comics in this directory are part of this series. comicinfo.py -o -f\"Spawn 066.cbr\" C:\Comics\Spawn ------------------------------------------------- This would update the \"Swawn 066.cbr\" comic book (and prompt since multiple matches will be found for \"Spawn\"«»). comicinfo.py -o -i12184 -f\"Spawn 066.cbr\" C:\Comics\Spawn ------------------------------------------------- This would update the \"Swawn 066.cbr\" comic book with data extracted from http://www.comicbookdb.com/issue.php?ID=12184 (the page for Spawn #66). comicinfo.py --rename=\"C:\Comics\%Series% (%Volume%)\%Series% %Number% (%Year%)\" C:\Comics -------------------------- This function would rename all comics in the C:\Comics directory to the specified format. [/code:1][file]

BACKUP YOUR FILES BEFORE USING THIS PROGRAM!

Scans all comic files (cbr/cbz/rar/zip) in specified path (recursively),
does best effort to lookup information on comicbookdb.com, and
create/inject comicinfo.xml.

This program is designed to be used with ComicRack.

Some notes regarding use of this program.

1) By default rar.exe (rar, cbr) and 7z[a].exe (zip, cbz) are used to
inject and update the ComicInfo.xml file inside the comic.
Both must be in your path or at their default install locations
C:\\Program Files\\Winrar\\ and C:\\Program Files\\7-Zip\\.
2) If you do not have rar and 7zip installed, you should use the -z option
(with significant limitations)

Options:
-o Overwrite existing ComicInfo.xml files.
-v Verbose
-f, --file= Only generate ComicInfo.xml for specified file. All other
files in the directory are ignored. This option will be
used automatically if a filename with a supported extension
is included as part of the PATH.
-t, --titleid= Specify the comicbookdb.com title id. This will be used to
match all comics in the specified path. Useful if you have
a large number of generic comics and don't want to manually
specify which is the correct match. Do not use if you have
mixed comics in the path (or below).
-i, --issueid= Specify a specific comicbookdb.com title id. This must be
used with the '-f' option to specify the comic file. This
option takes precidence over the '-t' option.
-r Recursively search subdirectories for comic files.
-u Update ComicInfo.xml using URL stored in the notes section
of a pre-existing ComicInfo.xml. Very useful if data has
been updated on comicbookcb (or if bugs have been fixed
in this program!) Overwrite is automatically enabled in
this mode.
--rename= Allows renaming and organization of comic files. Comic files
must contain a ComicInfo.xml file in order to be qualified
for the move/rename operation. Any of the fields found in
the ComicInfo.xml file can be used as part of the rename
operation. Each file must be surrounded by % (eg. %Title%).
Paths are relative to the current comic location. Filename
extensions are preserved.
-m When a comic is not found move the comic file to a 'noissue'
or 'notitle' subdirectory.
-e When multiple matches are found for a comic title eliminate
as many as possible before prompting.

Examples:

comicinfo.py -r C:\Comics\
This would recursively search for all comics in the c:\Comics\ directory.
Prompts will be given if a filename matches multiple titles and issues.


comicinfo.py -t89 -o C:\Comics\Spawn
This would search for all comics in the c:\Comics\Spawn directory. Any that
are found would be assumed to be from an issue found on the following web page:
www.comicbookdb.com/title.php?ID=89 (Spawn). Existing ComicInfo.xml
would be overwritten. Care should be taken to ensure that ALL comics in this
directory are part of this series.


comicinfo.py -o -f\"Spawn 066.cbr\" C:\Comics\Spawn
This would update the \"Swawn 066.cbr\" comic book (and prompt since multiple
matches will be found for \"Spawn\"«»).

comicinfo.py -o -i12184 -f\"Spawn 066.cbr\" C:\Comics\Spawn
This would update the \"Swawn 066.cbr\" comic book with data extracted from
www.comicbookdb.com/issue.php?ID=12184 (the page for Spawn #66).

comicinfo.py --rename=\"C:\Comics\%Series% (%Volume%)\%Series% %Number% (%Year%)\" C:\Comics
This function would rename all comics in the C:\Comics directory to the specified
format.

[/code:1]
Last Edit: 9 years 11 months ago by sharkus.
The administrator has disabled public write access.

Re:Sharkus ComicInfo 10 years 2 weeks ago #184

  • greenlanternprime
  • greenlanternprime's Avatar
  • Offline
  • Expert Boarder
  • Me Grimlock.. Bad Ass!
  • Posts: 103
  • Karma: 10
Cool, nice to see you are still around, I use the script all the time and i'm just trying to do my part to promote it!

Keep up the good work!
The administrator has disabled public write access.

Re:Sharkus ComicInfo 10 years 1 week ago #202

  • wadegiles
  • wadegiles's Avatar
  • Offline
  • Gold Boarder
  • Posts: 248
  • Thank you received: 3
  • Karma: 20
I used portions of ComicInfo to produce a ComicRack integrated script with slightly reduced functionality (no annual issue lookup). Check for a new post to get the information.
The administrator has disabled public write access.

Re:Sharkus ComicInfo 9 years 11 months ago #330

  • scrooge
  • scrooge's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 6
  • Karma: 0
I haven't used this script in a couple of weeks, but tried last night and ran into problems. I keep getting back \"multiple matches found\", even got that on a title with only one issue. After getting multiple matches it used to then list the possible matches and I could pick one, now it just gives me the option to skip or move. Anyone else having this problem? Did comicbookdb change something that might be causing this?
The administrator has disabled public write access.

Re:Sharkus ComicInfo 9 years 11 months ago #335

  • sharkus
  • sharkus's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 3
Not sure if the comicbookdb changes were done to defeat scrubbing scripts. They look a bit arbitrary. In any case, here's a quick update that hopefully will work for now...

Removed at request of comicbookdb.
Attachments:
Last Edit: 9 years 11 months ago by sharkus.
The administrator has disabled public write access.

Re:Sharkus ComicInfo 9 years 11 months ago #337

  • scrooge
  • scrooge's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 6
  • Karma: 0
Thanks sharkus, that is definitely working better. I still have a couple of problems that I didn't have before though. On issues that have a variant cover listed on the site it isn't finding the match. Also, less often, I get titles that have multiple matches found, but it only gives the move or skip option instead of a list to choose from.

I think I mentioned it on the old forum, but in case you forgot, I love this script! Also love ComicRack. I still scratch my head wondering why both aren't massively popular. I think they will be though with a little more time.

Thanks for updating this even after joining your cult :)
The administrator has disabled public write access.

Re:Sharkus ComicInfo 9 years 11 months ago #338

  • sharkus
  • sharkus's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 7
  • Karma: 3
Hi Scrooge, can you reply with links to the comics and/or series pages that are not working?
The administrator has disabled public write access.

Re:Sharkus ComicInfo 9 years 11 months ago #339

  • scrooge
  • scrooge's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 6
  • Karma: 0
Sharkus, you have a PM. It looks like it is having trouble with titles that include weird characters, such as : or /. The issues it misses are those with variant covers, which comicbookdb lists with a + in front of the issue number.
The administrator has disabled public write access.
Time to create page: 0.241 seconds

Who's Online

We have 245 guests and 5 members online