Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
This looks awesome - am truely impressed you went to the time to put this all together!

One question though - is there any way to add an option to have the subtitles embedded in the video but *not* burned in? As I understand it recent versions of handbrake support the functionality.
 
This looks awesome - am truely impressed you went to the time to put this all together!

One question though - is there any way to add an option to have the subtitles embedded in the video but *not* burned in? As I understand it recent versions of handbrake support the functionality.

Hi Chimaera!

You can override Batch Encode's preset encode settings by using the Custom Encode Setting options in the workflow.

Batch Encode's preset encode settings will burn in forced subtitles in your native language (small segments of dialog in another language); or all subtitles if the main audio language is not the native language set in the action.

For example, in Batch Encode, if your Native Language is set to English and the "Use default audio" option is turned on; when you run Batch Encode it will burn-in only the subtitles for the "terrorist" dialog in Iron Man, and all the subtitles for the Japanese dialog in Kurosawa's Seven Samurai.

Like I said before, you can override this functionality by using your own custom setting. To burn a subtitle track, you use the "--subtitle-burn" argument. To embed a subtitle you omit this argument. You can use the arguments below as a starting point.

However, A WORD OF WARNING. Embedding subtitles may not be very user-friendly. I haven't tried it in a while, but in the past you'd have to manually turn the subtitle track on during playback. This was the case for the Apple TV, Front Row, iTunes, Plex, pretty much everything. This might be fine for the occasional foreign film, but if you have to do it before every movie that may or may not include forced-subtitles, then it's not very functional. This is why Batch Encode's presets include the "--subtitle-burn" option by default.

EXAMPLE (using ATV2 preset):
Code:
-e x264  -q 20.0 -r 29.97 --pfr  -a \$audioTrack,\$audioTrack -E ca_aac,copy:ac3 -B 160,160 -6 dpl2,auto -R Auto,Auto -D 0.0,0.0 -f mp4 -4 --width 1280 --maxHeight 720  -m --subtitle scan --subtitle-forced scan --native-language \$nativeLanguage

I hope this helps.

Thanks!

mac.jedi
 
I hope this helps.

Thanks!

mac.jedi

It does indeed - thanks :)

You're quite right about the relative user-friendlyness of such a setup but I've always preferred doing it that way anyway - some nebulous idea of portability if I ever wanted to replace or change the embedded subs.

Thanks again!

D
 
I looked into this further and there seems to be an issue with the tvdb's data for Parenthood (2010) Season 3, either damaged, not updated or incomplete. The other seasons work fine.

Thanks for the lookup. How can I fix or help with this scenario. I also ran into this with Fringe S04E01. How can I track whats causing the issue in thetvdb end, so I can fix it for me, and others. Log files that show what fails?
 
mac.jedi.

Can we have it so it doesnt add the -1 on the end of files that come out of the Batch Rip TV folder? Or how can we?

edit: I used hazel's custom tokens...
 
Last edited:
Interesting. I have noticed since I am converting a ton of my dvd tv shows, that some just plain refuse to tag. Here is one in perticular:
http://thetvdb.com/?tab=episode&seriesid=82283&seasonid=33133&id=371474&lid=7

Is it due to the name of the episode being: Plaisir D'Amour -??

The episode name is fine. It's failing because of the latin character in the actor's name "Alexander Skarsgård"

In the Add TV Tag action's main.command file there is a subroutine called "function substituteISO88591 ()". Typically, the data returned would have the "å" equivalent, but in this case it looks like it's returning the actual character.

You'll need to add the following string to the sed command.
Code:
-e 's|å|a|g'

Thanks for letting me know.

mac.jedi
 
Thanks for the lookup. How can I fix or help with this scenario. I also ran into this with Fringe S04E01. How can I track whats causing the issue in thetvdb end, so I can fix it for me, and others. Log files that show what fails?

I just tested this one and it tags fine for me. Have you tried it recently?

Update: I also just tried Parenthood (2010) Season 3 and they are all working now. thetvdb.com must have been having some issues or going through some changes.

Note: These work without the fix I suggested for True Blood.
 
Last edited:
AppleScript to tag as TV Show?

I have some shows that just won't get tagged, and typically these are shows I don't keep around anyways so it's not a big deal, but I would like to be able to mark them as a TV show even if tagging fails.

I've scoured the internet for a way to do this with my limited AppleScripting skills. Can anyone help me out?
 
I have some shows that just won't get tagged, and typically these are shows I don't keep around anyways so it's not a big deal, but I would like to be able to mark them as a TV show even if tagging fails.

I've scoured the internet for a way to do this with my limited AppleScripting skills. Can anyone help me out?

Are you trying to set the file's "Media Type" so it will show up in iTunes "TV Shows" section?

If so, you can create a simple Automator Service using mp4tags; a command-line utility that's installed along with the Batch Rip Actions.

Here's a quick rundown on how to set up your new Service workflow:

  1. Open Automator.
  2. Choose File > New.
  3. Select the Services template, and then click Choose.
  4. Choose "Movie File" in the “Service receives selected” pop-up menu.
  5. Choose "Finder" from the “in” pop-up menu.
  6. Locate the "Run Shell Script" action in the "Utilities" section of the Actions library list on the left side of the window and drag it into the workflow area on the right.
  7. Choose "as arguments" in the “Pass input” pop-up menu.
  8. Copy and paste the code below into the panel's text area; replacing any existing text.
    Code:
    for f in "$@"
    do
    	/usr/local/bin/mp4tags -i 10 "$f"
    done
  9. Choose File > Save; rename the service and click Save.

    Note: If you'd like to create one to set the media type to movie, you'd use 9 instead of 10 in the code above.


I hope this helps!

mac.jedi
 
I'd rather figure out a way for Hazel to do it rather than adding something to the action. A down and dirty way to do it would be to have Hazel match all movie files then add a "Run Shell Script" on the matched file to see if it's got a genre added:

Code:
mp4infoPath="/usr/local/bin/mp4info"
getGenre=`"$mp4infoPath" "$1" | grep "Genre"`
fileNameNoExtension=`basename "$1" .m4v`
fileDir=`dirname "$1"`
untaggedFileName="${fileNameNoExtension}-untagged.m4v"
taggedFileName="${fileNameNoExtension}-tagged.m4v"
if [ -z "$getGenre" ]; then
	# Rename File if no genre is found
	mv "$1" "${fileDir}/${untaggedFileName}"
else
	# Rename File if genre is found
	mv "$1" "${fileDir}/${taggedFileName}"
fi

I hope this helps a bit :)

I have been using this perfectly. However I notice some things are not pulling down genre's (not your problem). instead of the Genre, can we check for artist or year or something. If so, whats that variable?

Here is todays example: http://www.themoviedb.org/movie/52449# It has a genre, but the tag and rename movie will not insert it. Import it into itunes shows no genre. Am I missing something?


On a second question, what is the requirements for a artwork integrity check.
For example: http://thetvdb.com/?tab=season&seriesid=164501&seasonid=474577&lid=7 fails the integrity check. My first thought was due to the fact that it was missing, but it is there, and matches thetvdb.org's requirements. And I guess is there a way to just allow it? If these communities have their own policing/etc maybe we could remove that requirement. Just asking/inquiring.
 
Last edited:
I have been using this perfectly. However I notice some things are not pulling down genre's (not your problem). instead of the Genre, can we check for artist or year or something. If so, whats that variable?

In Terminal, type: /usr/local/bin/mp4info /path/to/file.mp4
This will list all the tags that exist in the file. Take a look at what's listed and choose a keyword that you'd like Hazel to search for. In Hazel, replace "Genre" in the grep command with your new keyword. Hazel will now act on any file that's tagged with that keyword.

Here is todays example: http://www.themoviedb.org/movie/52449# It has a genre, but the tag and rename movie will not insert it. Import it into itunes shows no genre. Am I missing something?

It should tag it as a comedy. I'll have to do some testing to see what the action comes back with.

On a second question, what is the requirements for a artwork integrity check.
For example: http://thetvdb.com/?tab=season&seriesid=164501&seasonid=474577&lid=7 fails the integrity check. My first thought was due to the fact that it was missing, but it is there, and matches thetvdb.org's requirements. And I guess is there a way to just allow it? If these communities have their own policing/etc maybe we could remove that requirement. Just asking/inquiring.

From what I remember, it downloads the first artwork file from the database then tests to make sure the file size is not 0. Sometimes the format or download fails or the file is corrupt. I've thought about making it loop through the list, but never got around to it. For now, you can try using the Add poster service to select a poster and add it to the file.
 
On a second question, what is the requirements for a artwork integrity check.
For example: http://thetvdb.com/?tab=season&seriesid=164501&seasonid=474577&lid=7 fails the integrity check. My first thought was due to the fact that it was missing, but it is there, and matches thetvdb.org's requirements. And I guess is there a way to just allow it? If these communities have their own policing/etc maybe we could remove that requirement. Just asking/inquiring.

I forgot to explain why we need to test the image in the first place.

Let's say the action downloaded a bad cover art file. Without the test we have no way of knowing the file is bad, so we just pass the image's file path along to AtomicParsley, along with all the other tags. AtomicParsley will not only fail to add any of the tags, but in some cases corrupt the movie file as well.

In my experience, it doesn't happen that often … but when it does, it's better to have missing cover art than an unplayable file. I hope this helps clarify why we need to test the image after we've tried to download it.

Thanks!

mac.jedi
 
Here is todays example: http://www.themoviedb.org/movie/52449# It has a genre, but the tag and rename movie will not insert it. Import it into itunes shows no genre. Am I missing something?

I ran the service on a file and it renamed and tagged correctly for me. There could be a problem with your file. Try another file and just rename it to this one, and see if it tags correctly.

Here's the output from tag inspector so you can see how it tagged on my end … unfortunately whoever updated this movie didn't add the description in english :(

Code:
--------------------------------------------------------------------------------------------------------------
TAG INFORMATION FROM MP4INFO:
--------------------------------------------------------------------------------------------------------------

Track	Type	Info
1	video	H264 Baseline@3, 1440.439 secs, 1884 kbps, 704x480 @ 24.308561 fps
2	audio	MPEG-4 AAC LC, 1440.448 secs, 164 kbps, 48000 Hz
3	audio	ac-3, 1440.448 secs, 448 kbps, 48000 Hz
23	text
 Name: Bad Teacher (2011)
 Artist: Jason Segel, Cameron Diaz, Justin Timberlake, Lucy Punch
 Release Date: 2011-06-24
 Cover Art pieces: 1
 Short Description: Sommige docenten doen maar wat. Elizabeth (Cameron Diaz), bijvoorbeeld. Ze is meedogenloos, onaangepast en vloekt er op los. Ze drinkt, wordt regelmatig high en wil niets liever dan een rijke man aan de haak slaan, zodat ze kan stoppen met haar flutbaan. Als ze gedumpt wordt door haar verloofde, zet ze alles op alles om een rijke, knappe vervanger (Justin Timberlake) voor zich te winnen. Elizabeth gaat de strijd aan met haar overenthousiaste collega Amy (Lucy Punch) en gaat niet in op de avances van een sarcastische, onfatsoenlijke gymleraar (Jason Segel).
 Long Description: Sommige docenten doen maar wat. Elizabeth (Cameron Diaz), bijvoorbeeld. Ze is meedogenloos, onaangepast en vloekt er op los. Ze drinkt, wordt regelmatig high en wil niets liever dan een rijke man aan de haak slaan, zodat ze kan stoppen met haar flutbaan. Als ze gedumpt wordt door haar verloofde, zet ze alles op alles om een rijke, knappe vervanger (Justin Timberlake) voor zich te winnen. Elizabeth gaat de strijd aan met haar overenthousiaste collega Amy (Lucy Punch) en gaat niet in op de avances van een sarcastische, onfatsoenlijke gymleraar (Jason Segel).
 Purchase Date: 2011-09-27 19:37:09

--------------------------------------------------------------------------------------------------------------
TAG INFORMATION FROM ATOMICPARSLEY64:
--------------------------------------------------------------------------------------------------------------

Atom "©nam" contains: Bad Teacher (2011)
Atom "©ART" contains: Jason Segel, Cameron Diaz, Justin Timberlake, Lucy Punch
Atom "©day" contains: 2011-06-24
Atom "purd" contains: 2011-09-27 19:37:09
Atom "com.apple.iTunes;iTunEXTC" contains: mpaa|R|400|
Atom "gnre" contains: Comedy
Atom "desc" contains: Sommige docenten doen maar wat. Elizabeth (Cameron Diaz), bijvoorbeeld. Ze is meedogenloos, onaangepast en vloekt er op los. Ze drinkt, wordt regelmatig high en wil niets liever dan een rijke man aan de haak slaan, zodat ze kan stoppen met haar flutbaan. Als ze gedumpt wordt door haar verloofde, zet ze alles op alles om een rijke, knappe vervanger (Justin Timberlake) voor zich te winnen. Elizabeth gaat de strijd aan met haar overenthousiaste collega Amy (Lucy Punch) en gaat niet in op de avances van een sarcastische, onfatsoenlijke gymleraar (Jason Segel).
Atom "ldes" contains: Sommige docenten doen maar wat. Elizabeth (Cameron Diaz), bijvoorbeeld. Ze is meedogenloos, onaangepast en vloekt er op los. Ze drinkt, wordt regelmatig high en wil niets liever dan een rijke man aan de haak slaan, zodat ze kan stoppen met haar flutbaan. Als ze gedumpt wordt door haar verloofde, zet ze alles op alles om een rijke, knappe vervanger (Justin Timberlake) voor zich te winnen. Elizabeth gaat de strijd aan met haar overenthousiaste collega Amy (Lucy Punch) en gaat niet in op de avances van een sarcastische, onfatsoenlijke gymleraar (Jason Segel).
Atom "com.apple.iTunes;iTunMOVI" contains: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>cast</key>
    <array>
      <dict>
        <key>name</key>
        <string>Jason Segel</string>
      </dict>
      <dict>
        <key>name</key>
        <string>Cameron Diaz</string>
      </dict>
      <dict>
        <key>name</key>
        <string>Justin Timberlake</string>
      </dict>
      <dict>
        <key>name</key>
        <string>Lucy Punch</string>
      </dict>
    </array>
    <key>directors</key>
    <array>
      <dict>
        <key>name</key>
        <string>Jake Kasdan</string>
      </dict>
    </array>
    <key>screenwriters</key>
    <array/>
    <key>producers</key>
    <array/>
  </dict>
</plist>
Atom "covr" contains: 1 piece of artwork
 
I ran the service on a file and it renamed and tagged correctly for me. There could be a problem with your file. Try another file and just rename it to this one, and see if it tags correctly.

Here's the output from tag inspector so you can see how it tagged on my end … unfortunately whoever updated this movie didn't add the description in english :(

Code:
--------------------------------------------------------------------------------------------------------------
TAG INFORMATION FROM MP4INFO:
--------------------------------------------------------------------------------------------------------------

Track	Type	Info
1	video	H264 Baseline@3, 1440.439 secs, 1884 kbps, 704x480 @ 24.308561 fps
2	audio	MPEG-4 AAC LC, 1440.448 secs, 164 kbps, 48000 Hz
3	audio	ac-3, 1440.448 secs, 448 kbps, 48000 Hz
23	text
 Name: Bad Teacher (2011)
 Artist: Jason Segel, Cameron Diaz, Justin Timberlake, Lucy Punch
 Release Date: 2011-06-24
 Cover Art pieces: 1
 Short Description: Sommige docenten doen maar wat. Elizabeth (Cameron Diaz), bijvoorbeeld. Ze is meedogenloos, onaangepast en vloekt er op los. Ze drinkt, wordt regelmatig high en wil niets liever dan een rijke man aan de haak slaan, zodat ze kan stoppen met haar flutbaan. Als ze gedumpt wordt door haar verloofde, zet ze alles op alles om een rijke, knappe vervanger (Justin Timberlake) voor zich te winnen. Elizabeth gaat de strijd aan met haar overenthousiaste collega Amy (Lucy Punch) en gaat niet in op de avances van een sarcastische, onfatsoenlijke gymleraar (Jason Segel).
 Long Description: Sommige docenten doen maar wat. Elizabeth (Cameron Diaz), bijvoorbeeld. Ze is meedogenloos, onaangepast en vloekt er op los. Ze drinkt, wordt regelmatig high en wil niets liever dan een rijke man aan de haak slaan, zodat ze kan stoppen met haar flutbaan. Als ze gedumpt wordt door haar verloofde, zet ze alles op alles om een rijke, knappe vervanger (Justin Timberlake) voor zich te winnen. Elizabeth gaat de strijd aan met haar overenthousiaste collega Amy (Lucy Punch) en gaat niet in op de avances van een sarcastische, onfatsoenlijke gymleraar (Jason Segel).
 Purchase Date: 2011-09-27 19:37:09

--------------------------------------------------------------------------------------------------------------
TAG INFORMATION FROM ATOMICPARSLEY64:
--------------------------------------------------------------------------------------------------------------

Atom "©nam" contains: Bad Teacher (2011)
Atom "©ART" contains: Jason Segel, Cameron Diaz, Justin Timberlake, Lucy Punch
Atom "©day" contains: 2011-06-24
Atom "purd" contains: 2011-09-27 19:37:09
Atom "com.apple.iTunes;iTunEXTC" contains: mpaa|R|400|
Atom "gnre" contains: Comedy
Atom "desc" contains: Sommige docenten doen maar wat. Elizabeth (Cameron Diaz), bijvoorbeeld. Ze is meedogenloos, onaangepast en vloekt er op los. Ze drinkt, wordt regelmatig high en wil niets liever dan een rijke man aan de haak slaan, zodat ze kan stoppen met haar flutbaan. Als ze gedumpt wordt door haar verloofde, zet ze alles op alles om een rijke, knappe vervanger (Justin Timberlake) voor zich te winnen. Elizabeth gaat de strijd aan met haar overenthousiaste collega Amy (Lucy Punch) en gaat niet in op de avances van een sarcastische, onfatsoenlijke gymleraar (Jason Segel).
Atom "ldes" contains: Sommige docenten doen maar wat. Elizabeth (Cameron Diaz), bijvoorbeeld. Ze is meedogenloos, onaangepast en vloekt er op los. Ze drinkt, wordt regelmatig high en wil niets liever dan een rijke man aan de haak slaan, zodat ze kan stoppen met haar flutbaan. Als ze gedumpt wordt door haar verloofde, zet ze alles op alles om een rijke, knappe vervanger (Justin Timberlake) voor zich te winnen. Elizabeth gaat de strijd aan met haar overenthousiaste collega Amy (Lucy Punch) en gaat niet in op de avances van een sarcastische, onfatsoenlijke gymleraar (Jason Segel).
Atom "com.apple.iTunes;iTunMOVI" contains: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>cast</key>
    <array>
      <dict>
        <key>name</key>
        <string>Jason Segel</string>
      </dict>
      <dict>
        <key>name</key>
        <string>Cameron Diaz</string>
      </dict>
      <dict>
        <key>name</key>
        <string>Justin Timberlake</string>
      </dict>
      <dict>
        <key>name</key>
        <string>Lucy Punch</string>
      </dict>
    </array>
    <key>directors</key>
    <array>
      <dict>
        <key>name</key>
        <string>Jake Kasdan</string>
      </dict>
    </array>
    <key>screenwriters</key>
    <array/>
    <key>producers</key>
    <array/>
  </dict>
</plist>
Atom "covr" contains: 1 piece of artwork

Interesting. Here is what I get:
Code:
/usr/local/bin/AtomicParsley64 /Users/james/Movies/Batch\ Encode/Bad\ Teacher\ \(2011\).m4v -t
Atom "com.apple.iTunes;iTunEXTC" contains: mpaa|R|400|
Atom "com.apple.iTunes;iTunMOVI" contains: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>cast</key>
    <array>
      <dict>
        <key>name</key>
        <string>Jason Segel</string>
      </dict>
      <dict>
        <key>name</key>
        <string>Cameron Diaz</string>
      </dict>
      <dict>
        <key>name</key>
        <string>Justin Timberlake</string>
      </dict>
      <dict>
        <key>name</key>
        <string>Lucy Punch</string>
      </dict>
    </array>
    <key>directors</key>
    <array>
      <dict>
        <key>name</key>
        <string>Jake Kasdan</string>
      </dict>
    </array>
    <key>screenwriters</key>
    <array/>
    <key>producers</key>
    <array/>
  </dict>
</plist>
Atom "©nam" contains: Bad Teacher (2011)
Atom "©ART" contains: Jason Segel, Cameron Diaz, Justin Timberlake, Lucy Punch
Atom "gnre" contains: 
Atom "©day" contains: 2011-06-24
Atom "desc" contains: A comedy centered around a foul-mouthed, junior high teacher who, after being dumped by her sugar daddy, begins to woo a colleague -- a move that pits her against a well-loved teacher.
Atom "ldes" contains: A comedy centered around a foul-mouthed, junior high teacher who, after being dumped by her sugar daddy, begins to woo a colleague -- a move that pits her against a well-loved teacher.
Atom "©too" contains: HandBrake 0.9.5 2011010300
Atom "purd" contains: 2011-09-27 22:42:52
Atom "hdvd" contains: 
Atom "cnID" contains: 
                      ~?#
Atom "covr" contains: 1 piece of artwork

This is using the 'tag and rename movie items'. I have told it to remove the tags, replace the file, etc. Still wont post a genre. Also, mine is in english, but thats maybe cause I edited the online version earlier today.

Odd. Very odd. Ideas?

Edit. Also tried it on a newly converted 200mb file that had nothing to do with the movie. Still the same result.
 
Last edited:
Are you trying to set the file's "Media Type" so it will show up in iTunes "TV Shows" section?

If so, you can create a simple Automator Service using mp4tags; a command-line utility that's installed along with the Batch Rip Actions.

Here's a quick rundown on how to set up your new Service workflow:

  1. Open Automator.
  2. Choose File > New.
  3. Select the Services template, and then click Choose.
  4. Choose "Movie File" in the “Service receives selected” pop-up menu.
  5. Choose "Finder" from the “in” pop-up menu.
  6. Locate the "Run Shell Script" action in the "Utilities" section of the Actions library list on the left side of the window and drag it into the workflow area on the right.
  7. Choose "as arguments" in the “Pass input” pop-up menu.
  8. Copy and paste the code below into the panel's text area; replacing any existing text.
    Code:
    for f in "$@"
    do
    	/usr/local/bin/mp4tags -i 10 "$f"
    done
  9. Choose File > Save; rename the service and click Save.

    Note: If you'd like to create one to set the media type to movie, you'd use 9 instead of 10 in the code above.


I hope this helps!

mac.jedi

This is exactly what I was trying to accomplish, had no idea it was built in to your stuff! The command line is over my head, but thanks for this info —*I can do this!

mac.Jedi rules! :)

One question: how would I set this up as a Workflow to use with Hazel?
 
Last edited:
One question: how would I set this up as a Workflow to use with Hazel?

Hi gcoghill!

You can use the same script I suggested before in Hazel … just change the "variable" from "$f" to "$1" (see below).

  1. In Hazel, set up a new rule and set some conditions like "Kind" is "Movie"
  2. Next, set "Do the following" to "Run Shell Script" > "Embedded Script"
  3. Copy and paste the script below into Hazel's "Edit Script" text area
    Code:
    # HAZEL (RUN SHELL SCRIPT): SET MEDIA TYPE TO TV SHOW
    /usr/local/bin/mp4tags -i 10 "$1"
  4. Click OK; Hazel will now set the media type to TV Show for any movie files that match the conditions you've set in the rule.


I hope this helps!

Thanks!

mac.jedi
 
curl and thetvdb.com

I'm having a strange issue with curl and thetvdb.com. Some episodes seem to trigger a gzip compressed file to be retrieved.

For example, today the following will return a gzip compressed file for me:
Code:
curl http://thetvdb.com/api/9F21AC232F30F34D/series/78901/default/6/3/en.xml

If I pipe it thru gunzip I get the readable text file:
Code:
curl http://thetvdb.com/api/9F21AC232F30F34D/series/78901/default/6/3/en.xml | gunzip

Obviously it's causing the tag scripts to fail. Does anyone know why this is happening? Or is there a way to make curl detect if the file is compressed and decompress it automatically?


Edit:
I just discovered if I add --compressed to the curl command it seems to work for all episodes I've tried:
Code:
curl --compressed http://thetvdb.com/api/9F21AC232F30F34D/series/78901/default/6/3/en.xml

I have no idea why sometimes a gzip compressed version is being sent by thetvdb.com.


Thanks. BTW, awesome work in this post.
 
Last edited:
I'm having a strange issue with curl and thetvdb.com. Some episodes seem to trigger a gzip compressed file to be retrieved.

Obviously it's causing the tag scripts to fail. Does anyone know why this is happening? Or is there a way to make curl detect if the file is compressed and decompress it automatically?

Hi Brandon!

Thanks for letting me know. I'm not sure if this is a bug in tvdb's api or an undocumented change. They used to only compress the xml for the entire series … so an app that needed it could download the data for every season and episode with one command.

I did a quick test and adding the "--compressed" option should work whether or not the data is compressed. I'll make the change permanent in the next release.

In the main.command file, you might wanna "find and replace" all the lines that contain "curl -Ls" with "curl -Ls --compressed"

Thanks!

mac.jedi
 
Hi Brandon!

Thanks for letting me know. I'm not sure if this is a bug in tvdb's api or an undocumented change. They used to only compress the xml for the entire series … so an app that needed it could download the data for every season and episode with one command.

I did a quick test and adding the "--compressed" option should work whether or not the data is compressed. I'll make the change permanent in the next release.

In the main.command file, you might wanna "find and replace" all the lines that contain "curl -Ls" with "curl -Ls --compressed"

Thanks!

mac.jedi

One more thing …

I've been seeing a lot more latin characters in the names and descriptions which is causing some issues … they used to mostly be hex equivalents.

You might also want to edit line 163 of the main.command file to read:

Code:
echo "$xmlFile" | iconv -f ISO-8859-1 -t UTF-8 | "$xmllintPath" --format --output "${sourceTmpFolder}/${searchTerm}-${season_episode}_tags_tmp.xml" -
 
One more thing …

I've been seeing a lot more latin characters in the names and descriptions which is causing some issues … they used to mostly be hex equivalents.

You might also want to edit line 163 of the main.command file to read:

Code:
echo "$xmlFile" | iconv -f ISO-8859-1 -t UTF-8 | "$xmllintPath" --format --output "${sourceTmpFolder}/${searchTerm}-${season_episode}_tags_tmp.xml" -

Awesome, I was just about to post about this. I'm using sublercli instead of atomicparsley, and it has issues with é and other characters in the episode description. I guess atomicparsley also has issues with these characters. I'll try your suggested code out today.
 
Where would one find this file? I am seeing hit-or-miss tagging as well.

FYI - This fix is only for the Add TV Tags.action.

In the Finder, navigate to /Library/Automator.
Right-click on the Add TV Tags.action file.
Choose > Show Package Contents.
Navigate to Contents/Resources/main.command.
You'll need to edit the file and save it as a "plain text" file.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.