Skip to content

Commit

Permalink
Text metadata option, if the file format is not supported. Hopefully …
Browse files Browse the repository at this point in the history
…concludes #27
  • Loading branch information
Xerbo committed Dec 9, 2019
1 parent 265af26 commit 56df254
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.png
*.bmp
*.gif
# Meta
*.meta
# Audio
*.mp3
*.wav
Expand Down
10 changes: 9 additions & 1 deletion furaffinity-dl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Arguments:
-n (N)unmber of images to download, starting from
the most recent submission
-w Over(Write) files if they already exist
-s (S)eperate metadata files, to make sure all
metadata is downloaded regardless of file
Examples:
$0 gallery/mylafox
Expand All @@ -56,7 +58,8 @@ metadata=true
rename=true
maxsavefiles="0"
overwrite=false
while getopts 'o:c:iphrnw:' flag; do
textmeta=false
while getopts 'o:c:n:iphrws' flag; do
case "${flag}" in
w) overwrite=true;;
o) outdir=${OPTARG};;
Expand All @@ -66,6 +69,7 @@ while getopts 'o:c:iphrnw:' flag; do
r) rename=false;;
n) maxsavefiles=${OPTARG};;
h) help;;
s) textmeta=true;;
*) help;;
esac
done
Expand Down Expand Up @@ -160,6 +164,10 @@ https://github.com/Xerbo/furaffinity-dl/issues" >&2

mime_type="$(file "$file")"

if [ $textmeta = true ]; then
echo -ne "Title: $title\nURL: $page\nFilename: $file_name\nDescription: $description" > "$file.meta"
fi

# Add metadata
if [[ $mime_type == *"audio"* ]]; then
# Use eyeD3 for injecting metadata into audio files (if it's installed)
Expand Down

0 comments on commit 56df254

Please sign in to comment.