Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Macao Legacy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MACAO
Macao Legacy
Commits
397a4e7f
Commit
397a4e7f
authored
6 months ago
by
David Rouquet
Browse files
Options
Downloads
Patches
Plain Diff
new script to extract media folder including swf contents
parent
74d2a757
No related branches found
No related tags found
1 merge request
!4
Main
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tetras_extraction/script/extract_all_media_from_folder.sh
+49
-0
49 additions, 0 deletions
tetras_extraction/script/extract_all_media_from_folder.sh
with
49 additions
and
0 deletions
tetras_extraction/script/extract_all_media_from_folder.sh
0 → 100755
+
49
−
0
View file @
397a4e7f
#!/bin/bash
# Check if the input and output folders are provided as arguments
if
[
$#
-lt
2
]
;
then
echo
"Usage:
$0
<input_folder> <output_folder>"
exit
1
fi
# Get the input and output folder paths
input_folder
=
"
$1
"
output_folder
=
"
$2
"
# Ensure the input folder exists
if
[
!
-d
"
$input_folder
"
]
;
then
echo
"Error: Input folder '
$input_folder
' does not exist."
exit
1
fi
# Create the output folder if it doesn't exist
mkdir
-p
"
$output_folder
"
# Loop through all files in the input folder
for
file
in
"
$input_folder
"
/
*
;
do
# Skip if no files are found
if
[
!
-e
"
$file
"
]
;
then
echo
"No files found in the input folder."
exit
0
fi
# Check if the file is an SWF file
if
[[
"
$file
"
==
*
.swf
]]
;
then
# Get the base name without extension
base_name
=
$(
basename
"
$file
"
.swf
)
# Create a subfolder for the extracted files
subfolder
=
"
${
output_folder
}
/
${
base_name
}
"
mkdir
-p
"
$subfolder
"
# Extract assets using swfextract into the subfolder
echo
"Processing SWF file:
$file
"
swfextract
--outputformat
"
${
subfolder
}
/
${
base_name
}
_%02d.%s"
-a
1-
"
$file
"
else
# Copy other files directly to the output folder
echo
"Copying non-SWF file:
$file
"
cp
"
$file
"
"
$output_folder
/"
fi
done
echo
"All files processed! SWF files are extracted and others are copied to '
$output_folder
'."
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment