/useful/trunk-1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/useful/trunk-1

« back to all changes in this revision

Viewing changes to scripts/video2lbry.sh

  • Committer: Gustav Hartvigsson
  • Date: 2024-07-21 15:58:37 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20240721155837-pk0qf8upbgjq216y
[do-offline-updates.sh] Woops.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#
5
5
# Encodes videos so they are ready to be uploaded to LBRY.
6
6
#
 
7
# Changes
 
8
# 2021-01-13
 
9
#   * fixed up if statments
 
10
#   * removed eval
 
11
#
7
12
####################
8
 
ARGS=()
9
 
ARGS="${@}"
10
13
 
11
 
__IN_NAME=
12
 
__OUT_NAME=
 
14
__IN_NAME=""
 
15
__OUT_NAME=""
13
16
 
14
17
__help () {
15
18
  echo "video2lbry.sh -- Make vide ready for upload to LBRY."
38
41
}
39
42
 
40
43
__parse_args() {
41
 
  if [ -z "$1" ]
 
44
  if [[ -z "$1" ]]
42
45
  then
43
46
    echo "Try --help or -h."
44
47
    exit 1
47
50
  
48
51
  while [[ $# -gt 0 ]]
49
52
  do
50
 
    eval key="${1}"
51
53
    
52
54
    case "${1}" in
53
55
      -i)
82
84
}
83
85
 
84
86
__main () {
85
 
  if [ ! -e "$__IN_NAME" ]
 
87
  if [[ ! -e "$__IN_NAME" ]]
86
88
  then
87
89
    echo "missing input audio. Please provide."
88
90
    exit 1
89
91
  fi
90
92
  
91
 
  if [ $__OUT_NAME == "" ]
 
93
  if [[ $__OUT_NAME == "" ]]
92
94
  then
93
95
    echo "missing output file name. Please provide."
94
96
    exit 1
95
97
  fi
96
98
  
97
99
  
98
 
  if [ $__IN_NAME = ${__OUT_NAME}_lbry.mp4 ]
 
100
  if [[ $__IN_NAME == ${__OUT_NAME}_lbry.mp4 ]]
99
101
  then
100
102
    echo "Filenames can't be the same."
101
103
    exit