/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-11-02 21:19:08 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20241102211908-ad9nwyj2sf3mpepv
* That's awkard...

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