Missing file after the command

Started by wesley, August 11, 2023, 11:53:26 PM

Previous topic - Next topic

wesley

I have been using this line forever, but recently it stopped working. and gives the error use '=' instead. I used to rename the file and place it in a folder of the authors name.

exiftool -overwrite_original "-filename<$Artist/$Title/$Artist-$Title.%e" TheWanderingSwordTheLastEternalBook1_ep7.m4b Warning: [minor] The ExtractEmbedded option may find more tags in the media data - TheWanderingSwordTheLastEternalBook1_ep7.m4b
Warning: No writable tags set from TheWanderingSwordTheLastEternalBook1_ep7.m4b
Warning: Invalid tag name '//-.%e'. Use '=' not '<' to assign a tag value - TheWanderingSwordTheLastEternalBook1_ep7.m4b
    0 image files updated
    1 image files unchanged
root@b3aa48eb79c0:/media# ls -al
total 1013459
drwxrwxrwx 1 nobody users         4 Aug 12 03:40 .
drwxr-xr-x 1 root   root        180 Aug 12 02:55 ..
-rw-rw-rw- 1 nobody users 522265790 Aug 11 20:23 TheWanderingSwordTheLastEternalBook1_ep7.aax
-rw-r--r-- 1 root   root  514650297 Aug 12 03:40 TheWanderingSwordTheLastEternalBook1_ep7.m4b

When I made the change, it did something, but now the file is missing
exiftool -overwrite_original "-filename=$Artist/$Title/$Artist-$Title.%e" TheWanderingSwordTheLastEternalBook1_ep7.m4b     1 image files updated
root@b3aa48eb79c0:/media# ls -al
total 510458
drwxrwxrwx 1 nobody users         3 Aug 12 03:46 .
drwxr-xr-x 1 root   root        190 Aug 12 03:46 ..
-rw-rw-rw- 1 nobody users 522265790 Aug 11 20:23 TheWanderingSwordTheLastEternalBook1_ep7.aax

Phil Harvey

The $ variables are interpreted by Unix shells inside double quotes.  You need to use single quotes to protect against the shell interpolation.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

wesley

Quote from: Phil Harvey on August 12, 2023, 06:51:40 AMThe $ variables are interpreted by Unix shells inside double quotes.  You need to use single quotes to protect against the shell interpolation.

- Phil

Thanks, that fixed most of the issue, but I still run into a problem with the command
exiftool -overwrite_original '-filename<$Artist/$Title/$Artist-$Title.%e' /media

I elected to do the whole directory /media at one time, and it mostly works. But the folder/filenames are not right.



I am not sure, but there is a ':' in the title for one but not others. If that is it, how to handle that?
Title : Stellarlune: Keeper of the Lost Cities, Book 9Title : Legacy
I attracted the exif data for both below.

ExifTool Version Number         : 12.60
File Name                       : Legacy_ep7.aax
Directory                       : .
File Size                       : 1329 MB
File Modification Date/Time     : 2023:08:11 14:57:22-05:00
File Access Date/Time           : 2023:08:12 16:33:38-05:00
File Inode Change Date/Time     : 2023:08:12 16:33:57-05:00
File Permissions                : -rwxrw-rw-
File Type                       : AAX
File Type Extension             : aax
MIME Type                       : audio/vnd.audible.aax
Major Brand                     : Audible Enhanced Audiobook (.AAX)
Minor Version                   : 0.0.1
Compatible Brands               : aax , M4B , mp42, isom
Movie Header Version            : 0
Create Date                     : 2023:08:11 19:52:37
Modify Date                     : 2023:08:11 19:52:37
Time Scale                      : 600
Duration                        : 22:55:27
Preferred Rate                  : 1
Preferred Volume                : 0.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 3
Track Header Version            : 0
Track Create Date               : 2023:08:11 19:52:37
Track Modify Date               : 2023:08:11 19:52:37
Track ID                        : 1
Track Duration                  : 22:55:27
Track Layer                     : 0
Track Volume                    : 100.00%
Chapter List Track ID           : 2
Balance                         : 0
Audio Format                    : aavd
Audio Channels                  : 2
Audio Bits Per Sample           : 16
Audio Sample Rate               : 44100
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Image Width                     : 160
Image Height                    : 160
Media Header Version            : 0
Media Create Date               : 2023:08:11 19:52:39
Media Modify Date               : 2023:08:11 19:52:39
Media Time Scale                : 44100
Media Duration                  : 22:55:28
Media Language Code             : eng
Handler Class                   : Media Handler
Handler Description             : Apple Text Media Handler
Gen Media Version               : 0
Gen Flags                       : 0 0 0
Gen Graphics Mode               : ditherCopy
Gen Op Color                    : 32768 32768 32768
Gen Balance                     : 0
Other Format                    : text
Warning                         : [minor] The ExtractEmbedded option may find more tags in the media data
Comment                         : Chapter 54
Handler Type                    : Metadata
Handler Vendor ID               : Apple
Title                           : Legacy
Artist                          : Shannon Messenger
Album Artist                    : Shannon Messenger
Album                           : Legacy
Genre                           : Audiobook
Product ID                      : BK_ADBL_033479
Description                     : Sophie Foster wants answers. But after a lifetime of lies, sometimes the truth is the most dangerous discovery. Even the smallest secret comes with terrifying new responsibilities. And Sophie's not the only one with blank spots in her past, or mysteries surrounding her family. She and her friends are part of something much bigger than they imagined - and their roles have already been chosen for them. Every clue drags them deeper into the conspiracy. Every memory forces them to question everything - especially one another.
Copyright                       : ©2019 Shannon Messenger (P)2019 Audible, Inc.
Publisher                       : Audible Studios
Content Create Date             : 2019
Narrator                        : Caitlin Kelly
Product Version                 : 11103071
GUID                            : A3FPGUDO942UKY
Parent Product ID               : BK_ADBL_033479
Short Title                     : Legacy
Release Date                    : 05-NOV-2019
Cover Art                       : (Binary data 56363 bytes, use -b option to extract)
Media Data Size                 : 1314305257
Media Data Offset               : 14943972
Image Size                      : 160x160
Megapixels                      : 0.026
Avg Bitrate                     : 127 kbps

And

ExifTool Version Number         : 12.60
File Name                       : StellarluneKeeperoftheLostCitiesBook9_ep7.aax
Directory                       : .
File Size                       : 1126 MB
File Modification Date/Time     : 2023:08:11 14:57:04-05:00
File Access Date/Time           : 2023:08:12 16:29:45-05:00
File Inode Change Date/Time     : 2023:08:12 16:30:01-05:00
File Permissions                : -rwxrw-rw-
File Type                       : AAX
File Type Extension             : aax
MIME Type                       : audio/vnd.audible.aax
Major Brand                     : Audible Enhanced Audiobook (.AAX)
Minor Version                   : 0.0.1
Compatible Brands               : aax , M4B , mp42, isom
Movie Header Version            : 0
Create Date                     : 2023:08:11 19:52:43
Modify Date                     : 2023:08:11 19:52:43
Time Scale                      : 600
Duration                        : 19:24:49
Preferred Rate                  : 1
Preferred Volume                : 0.00%
Preview Time                    : 0 s
Preview Duration                : 0 s
Poster Time                     : 0 s
Selection Time                  : 0 s
Selection Duration              : 0 s
Current Time                    : 0 s
Next Track ID                   : 3
Track Header Version            : 0
Track Create Date               : 2023:08:11 19:52:43
Track Modify Date               : 2023:08:11 19:52:43
Track ID                        : 1
Track Duration                  : 19:24:49
Track Layer                     : 0
Track Volume                    : 100.00%
Chapter List Track ID           : 2
Balance                         : 0
Audio Format                    : aavd
Audio Channels                  : 2
Audio Bits Per Sample           : 16
Audio Sample Rate               : 44100
Matrix Structure                : 1 0 0 0 1 0 0 0 1
Image Width                     : 160
Image Height                    : 160
Media Header Version            : 0
Media Create Date               : 2023:08:11 19:52:45
Media Modify Date               : 2023:08:11 19:52:45
Media Time Scale                : 44100
Media Duration                  : 19:24:49
Media Language Code             : eng
Handler Class                   : Media Handler
Handler Description             : Apple Text Media Handler
Gen Media Version               : 0
Gen Flags                       : 0 0 0
Gen Graphics Mode               : ditherCopy
Gen Op Color                    : 32768 32768 32768
Gen Balance                     : 0
Other Format                    : text
Warning                         : [minor] The ExtractEmbedded option may find more tags in the media data
Comment                         : Chapter 51
Handler Type                    : Metadata
Handler Vendor ID               : Apple
Title                           : Stellarlune: Keeper of the Lost Cities, Book 9
Artist                          : Shannon Messenger
Album Artist                    : Shannon Messenger
Album                           : Stellarlune: Keeper of the Lost Cities, Book 9
Genre                           : Audiobook
Product ID                      : BK_ADBL_033480
Description                     : Sophie Foster changed the game. Now she's facing impossible choices: When to act. When to trust. When to let go. Her friends are divided and scattered, and the Black Swan wants Sophie to focus on their projects. But her instincts are leading her somewhere else. Stellarlune—and the mysterious Elysian—might be the key to everything. But finding truth in the Lost Cities always requires sacrifice. And as the Neverseen's plans sharpen into terrifying focus, it appears that everyone has miscalculated. 
Copyright                       : ©2022 Shannon Messenger (P)2022 Audible, Inc.
Publisher                       : Audible Studios
Content Create Date             : 2022
Narrator                        : Caitlin Kelly
Product Version                 : 44853371
GUID                            : A3FPGUDO942UKY
Parent Product ID               : BK_ADBL_033480
Short Title                     : Stellarlune: Keeper of the Lost Cities, Book 9
Release Date                    : 15-NOV-2022
Cover Art                       : (Binary data 74159 bytes, use -b option to extract)
Media Data Size                 : 1113024127
Media Data Offset               : 12684496
Image Size                      : 160x160
Megapixels                      : 0.026
Avg Bitrate                     : 127 kbps





wesley

I found the answer, by adding this command
exiftool -overwrite_original -tagsfromfile @ -Artist -Title -api "filter=s/[^\s\w()\-\"\'%\/+]/ /g" "$m4a_file"