/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: 2021-01-13 20:18:48 UTC
  • Revision ID: git-v1:df5c8db5509b9612b896bd2a9fc8b50ee5eedb1e
You can use git on Launchpad too.

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