Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 5012  / 3 Years ago, fri, july 23, 2021, 4:50:31

swftools are a unique set of tools but lack some user friendliness. They can't even iterate over provided objects:




Only one file allowed. You supplied at least two.




$ swfextract file.swf -i 1,2
warning! You should use the -P when extracting multiple objects

$ ls
file.swf output.swf

$ swfextract file.swf -i 1,2 -P

$ ls
file.swf output.swf

More From » extract

 Answers
6

Here is a bash script to automate it:



#!/bin/bash
find_ext=".swf"
out_ext=".jpg"

[ "$1" == "" ] && echo "Add type arguments from swfextract: -j -p -f -F -m -i" && exit 1

for arg in $@; do
for file in `find . -name "*$find_ext"`; do
ids="`swfextract $file | grep "[$arg]" | sed 's#^.*ID(s) ##g' | sed 's#, # #g'`"
for id in $ids; do
swfextract "$file" $arg $id -o "${file}_${id}${out_ext}"
done
done
done


Don't forget to check the *_ext variables.
Feel free to improve the script by adding extensions automatically.


[#32471] Saturday, July 24, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
percol

Total Points: 493
Total Questions: 116
Total Answers: 107

Location: Taiwan
Member since Mon, Sep 6, 2021
3 Years ago
percol questions
Thu, Sep 29, 22, 07:42, 2 Years ago
Sat, Jul 16, 22, 21:00, 2 Years ago
Tue, May 30, 23, 19:16, 1 Year ago
Wed, Aug 18, 21, 02:15, 3 Years ago
;