(CommandList
  children: [
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: (BoolUnary op_id:BoolUnary_d child:{($ VSub_Name '$HOME') (/.cache/ytview)})
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (Sentence
              child: (C {(rm)} {(-rf)} {($ VSub_Name '$HOME') (/.cache/ytview/)})
              terminator: <Op_Semi ';'>
            )
          ]
          spids: [16777215 21]
        )
      ]
      spids: [16777215 31]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:player) op:Equal rhs:{(DQ )} spids:[34])]
      spids: [34]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:configuredClient) op:Equal rhs:{(DQ )} spids:[38])]
      spids: [38]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:currentVersion) op:Equal rhs:{(DQ (1.11.1))} spids:[42])]
      spids: [42]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:flag) op:Equal rhs:{(DQ )} spids:[47])]
      spids: [47]
    )
    (FuncDef
      name: getConfiguredClient
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(command)} {(-v)} {(curl)})
                      terminator: <Op_Amp '&'>
                    )
                    (Sentence
                      child: 
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [71]
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:configuredClient)
                          op: Equal
                          rhs: {(DQ (curl))}
                          spids: [79]
                        )
                      ]
                      spids: [79]
                    )
                  ]
                  spids: [16777215 76]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(command)} {(-v)} {(wget)})
                      terminator: <Op_Amp '&'>
                    )
                    (Sentence
                      child: 
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [94]
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:configuredClient)
                          op: Equal
                          rhs: {(DQ (wget))}
                          spids: [102]
                        )
                      ]
                      spids: [102]
                    )
                  ]
                  spids: [85 99]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: (C {(command)} {(-v)} {(fetch)})
                      terminator: <Op_Amp '&'>
                    )
                    (Sentence
                      child: 
                        (SimpleCommand
                          redirects: [
                            (Redir
                              op_id: Redir_Great
                              fd: 16777215
                              arg_word: {(/dev/null)}
                              spids: [117]
                            )
                          ]
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (Assignment
                      keyword: Assign_None
                      pairs: [
                        (assign_pair
                          lhs: (LhsName name:configuredClient)
                          op: Equal
                          rhs: {(DQ (fetch))}
                          spids: [125]
                        )
                      ]
                      spids: [125]
                    )
                  ]
                  spids: [108 122]
                )
              ]
              else_action: [
                (SimpleCommand
                  words: [
                    {(echo)}
                    {(DQ ('Error: This tool reqires either curl, wget, or fetch to be installed.'))}
                  ]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[140])]
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
              ]
              spids: [131 149]
            )
          ]
          spids: [59]
        )
      spids: [55 58]
    )
    (FuncDef
      name: checkInternet
      body: 
        (BraceGroup
          children: [
            (Pipeline
              children: [
                (C {(echo)} {(-e)} 
                  {(DQ ('GET http://google.com HTTP/1.0') (Lit_Other '\\') (n) (Lit_Other '\\') (n))}
                )
                (SimpleCommand
                  words: [{(nc)} {(google.com)} {(80)}]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(/dev/null)}
                      spids: [181]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[185])
                  ]
                )
              ]
              negated: False
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (C {(Lit_Other '[')} {($ VSub_QMark '$?')} {(-eq)} {(0)} {(Lit_Other ']')})
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [(ControlFlow token:<ControlFlow_Return return> arg_word:{(0)})]
                  spids: [16777215 205]
                )
              ]
              else_action: [
                (SimpleCommand
                  words: [{(echo)} {(DQ ('Error: no active internet connection'))}]
                  redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[225])]
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
              ]
              spids: [216 237]
            )
          ]
          spids: [158]
        )
      spids: [154 157]
    )
    (FuncDef
      name: httpGet
      body: 
        (BraceGroup
          children: [
            (Case
              to_match: {(DQ ($ VSub_Name '$configuredClient'))}
              arms: [
                (case_arm
                  pat_list: [{(curl)}]
                  action: [(C {(curl)} {(-A)} {(curl)} {(-s)} {(DQ ($ VSub_At '$@'))})]
                  spids: [261 262 275 16777215]
                )
                (case_arm
                  pat_list: [{(wget)}]
                  action: [(C {(wget)} {(-qO-)} {(DQ ($ VSub_At '$@'))})]
                  spids: [278 279 288 16777215]
                )
                (case_arm
                  pat_list: [{(fetch)}]
                  action: [(C {(fetch)} {(-o)} {(DQ (...))})]
                  spids: [291 292 301 16777215]
                )
              ]
              spids: [252 258 304]
            )
          ]
          spids: [249]
        )
      spids: [245 248]
    )
    (FuncDef
      name: update
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:repositoryName)
                  op: Equal
                  rhs: {(DQ (Bash-Snippets))}
                  spids: [328]
                )
              ]
              spids: [328]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:githubUserName)
                  op: Equal
                  rhs: {(DQ (alexanderepstein))}
                  spids: [337]
                )
              ]
              spids: [337]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:nameOfInstallFile)
                  op: Equal
                  rhs: {(DQ (install.sh))}
                  spids: [346]
                )
              ]
              spids: [346]
            )
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:latestVersion)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(httpGet)} 
                                    {(https) (Lit_Other ':') (//api.github.com/repos/) 
                                      ($ VSub_Name '$githubUserName') (/) ($ VSub_Name '$repositoryName') (/tags)
                                    }
                                  )
                                  (C {(grep)} {(-Eo)} {(SQ <'"name":.*?[^\\\\]",'>)})
                                  (C {(head)} {(-1)})
                                  (C {(grep)} {(-Eo)} {(DQ ('[0-9.]+'))})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [356 392]
                      )
                    }
                  spids: [355]
                )
              ]
              spids: [355]
            )
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (LogicalOr
                              left: 
                                (BoolBinary
                                  op_id: BoolBinary_GlobDEqual
                                  left: {($ VSub_Name '$currentVersion')}
                                  right: {(DQ )}
                                )
                              right: 
                                (LogicalOr
                                  left: 
                                    (BoolBinary
                                      op_id: BoolBinary_GlobDEqual
                                      left: {($ VSub_Name '$repositoryName')}
                                      right: {(DQ )}
                                    )
                                  right: 
                                    (LogicalOr
                                      left: 
                                        (BoolBinary
                                          op_id: BoolBinary_GlobDEqual
                                          left: {($ VSub_Name '$githubUserName')}
                                          right: {(DQ )}
                                        )
                                      right: 
                                        (BoolBinary
                                          op_id: BoolBinary_GlobDEqual
                                          left: {($ VSub_Name '$nameOfInstallFile')}
                                          right: {(DQ )}
                                        )
                                    )
                                )
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (SimpleCommand
                      words: [
                        {(echo)}
                        {(DQ ('Error: update utility has not been configured correctly.'))}
                      ]
                      redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[448])]
                    )
                    (C {(exit)} {(1)})
                  ]
                  spids: [16777215 439]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {($ VSub_Name '$latestVersion')}
                              right: {(DQ )}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (SimpleCommand
                      words: [{(echo)} {(DQ ('Error: no active internet connection'))}]
                      redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[479])]
                    )
                    (C {(exit)} {(1)})
                  ]
                  spids: [457 470]
                )
              ]
              else_action: [
                (If
                  arms: [
                    (if_arm
                      cond: [
                        (Sentence
                          child: 
                            (DBracket
                              expr: 
                                (BoolBinary
                                  op_id: BoolBinary_GlobNEqual
                                  left: {(DQ ($ VSub_Name '$latestVersion'))}
                                  right: {(DQ ($ VSub_Name '$currentVersion'))}
                                )
                            )
                          terminator: <Op_Semi ';'>
                        )
                      ]
                      action: [
                        (C {(echo)} {(DQ ('Version ') ($ VSub_Name '$latestVersion') (' available'))})
                        (C {(echo)} {(-n)} 
                          {
                            (DQ ('Do you wish to update ') ($ VSub_Name '$repositoryName') (' [Y/n]: '))
                          }
                        )
                        (C {(read)} {(-r)} {(answer)})
                        (If
                          arms: [
                            (if_arm
                              cond: [
                                (Sentence
                                  child: 
                                    (DBracket
                                      expr: 
                                        (LogicalOr
                                          left: 
                                            (BoolBinary
                                              op_id: BoolBinary_GlobDEqual
                                              left: {(DQ ($ VSub_Name '$answer'))}
                                              right: {(DQ (Y))}
                                            )
                                          right: 
                                            (BoolBinary
                                              op_id: BoolBinary_GlobDEqual
                                              left: {(DQ ($ VSub_Name '$answer'))}
                                              right: {(DQ (y))}
                                            )
                                        )
                                    )
                                  terminator: <Op_Semi ';'>
                                )
                              ]
                              action: [
                                (AndOr
                                  children: [
                                    (C {(cd)} {(TildeSubPart prefix:'')})
                                    (BraceGroup
                                      children: [
                                        (Sentence
                                          child: (C {(echo)} {(SQ <'Update Failed'>)})
                                          terminator: <Op_Semi ';'>
                                        )
                                        (Sentence
                                          child: (C {(exit)} {(1)})
                                          terminator: <Op_Semi ';'>
                                        )
                                      ]
                                      spids: [576]
                                    )
                                  ]
                                  op_id: Op_DPipe
                                )
                                (If
                                  arms: [
                                    (if_arm
                                      cond: [
                                        (Sentence
                                          child: 
                                            (DBracket
                                              expr: 
                                                (BoolUnary
                                                  op_id: BoolUnary_d
                                                  child: 
                                                    {(Lit_Tilde '~') (/) 
                                                      ($ VSub_Name '$repositoryName')
                                                    }
                                                )
                                            )
                                          terminator: <Op_Semi ';'>
                                        )
                                      ]
                                      action: [
                                        (Sentence
                                          child: 
                                            (AndOr
                                              children: [
                                                (C {(rm)} {(-r)} {(-f)} {($ VSub_Name '$repositoryName')})
                                                (BraceGroup
                                                  children: [
                                                    (Sentence
                                                      child: 
                                                        (C {(echo)} 
                                                          {
                                                            (DQ 
                                                              (
'Permissions Error: try running the update as sudo'
                                                              )
                                                            )
                                                          }
                                                        )
                                                      terminator: <Op_Semi ';'>
                                                    )
                                                    (Sentence
                                                      child: (C {(exit)} {(1)})
                                                      terminator: <Op_Semi ';'>
                                                    )
                                                  ]
                                                  spids: [620]
                                                )
                                              ]
                                              op_id: Op_DPipe
                                            )
                                          terminator: <Op_Semi ';'>
                                        )
                                      ]
                                      spids: [16777215 608]
                                    )
                                  ]
                                  spids: [16777215 638]
                                )
                                (AndOr
                                  children: [
                                    (C {(git)} {(clone)} 
                                      {
                                        (DQ ('https://github.com/') ($ VSub_Name '$githubUserName') (/) 
                                          ($ VSub_Name '$repositoryName')
                                        )
                                      }
                                    )
                                    (BraceGroup
                                      children: [
                                        (Sentence
                                          child: 
                                            (C {(echo)} {(DQ ("Couldn't download latest version"))})
                                          terminator: <Op_Semi ';'>
                                        )
                                        (Sentence
                                          child: (C {(exit)} {(1)})
                                          terminator: <Op_Semi ';'>
                                        )
                                      ]
                                      spids: [654]
                                    )
                                  ]
                                  op_id: Op_DPipe
                                )
                                (AndOr
                                  children: [
                                    (C {(cd)} {($ VSub_Name '$repositoryName')})
                                    (BraceGroup
                                      children: [
                                        (Sentence
                                          child: (C {(echo)} {(SQ <'Update Failed'>)})
                                          terminator: <Op_Semi ';'>
                                        )
                                        (Sentence
                                          child: (C {(exit)} {(1)})
                                          terminator: <Op_Semi ';'>
                                        )
                                      ]
                                      spids: [678]
                                    )
                                  ]
                                  op_id: Op_DPipe
                                )
                                (AndOr
                                  children: [
                                    (SimpleCommand
                                      words: [
                                        {(git)}
                                        {(checkout)}
                                        {(DQ (v) ($ VSub_Name '$latestVersion'))}
                                      ]
                                      redirects: [
                                        (Redir
                                          op_id: Redir_Great
                                          fd: 2
                                          arg_word: {(/dev/null)}
                                          spids: [705]
                                        )
                                      ]
                                    )
                                    (AndOr
                                      children: [
                                        (SimpleCommand
                                          words: [
                                            {(git)}
                                            {(checkout)}
                                            {(DQ ($ VSub_Name '$latestVersion'))}
                                          ]
                                          redirects: [
                                            (Redir
                                              op_id: Redir_Great
                                              fd: 2
                                              arg_word: {(/dev/null)}
                                              spids: [719]
                                            )
                                          ]
                                        )
                                        (C {(echo)} 
                                          {
                                            (DQ 
                                              (
"Couldn't git checkout to stable release, updating to latest commit."
                                              )
                                            )
                                          }
                                        )
                                      ]
                                      op_id: Op_DPipe
                                    )
                                  ]
                                  op_id: Op_DPipe
                                )
                                (C {(chmod)} {(a) (Lit_Other '+') (x)} {(install.sh)})
                                (AndOr
                                  children: [
                                    (C {(./) ($ VSub_Name '$nameOfInstallFile')} {(DQ (update))})
                                    (C {(exit)} {(1)})
                                  ]
                                  op_id: Op_DPipe
                                )
                                (C {(cd)} {(..)})
                                (AndOr
                                  children: [
                                    (C {(rm)} {(-r)} {(-f)} {($ VSub_Name '$repositoryName')})
                                    (BraceGroup
                                      children: [
                                        (Sentence
                                          child: 
                                            (C {(echo)} 
                                              {
                                                (DQ 
                                                  (
'Permissions Error: update succesfull but cannot delete temp files located at ~/'
                                                  ) ($ VSub_Name '$repositoryName') (' delete this directory with sudo')
                                                )
                                              }
                                            )
                                          terminator: <Op_Semi ';'>
                                        )
                                        (Sentence
                                          child: (C {(exit)} {(1)})
                                          terminator: <Op_Semi ';'>
                                        )
                                      ]
                                      spids: [773]
                                    )
                                  ]
                                  op_id: Op_DPipe
                                )
                              ]
                              spids: [16777215 567]
                            )
                          ]
                          else_action: [(C {(exit)} {(1)})]
                          spids: [792 800]
                        )
                      ]
                      spids: [16777215 508]
                    )
                  ]
                  else_action: [
                    (C {(echo)} 
                      {(DQ ($ VSub_Name '$repositoryName') (' is already the latest version'))}
                    )
                  ]
                  spids: [803 814]
                )
              ]
              spids: [488 817]
            )
          ]
          spids: [313]
        )
      spids: [309 312]
    )
    (FuncDef
      name: getConfiguredPlayer
      body: 
        (BraceGroup
          children: [
            (If
              arms: [
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_Name '$OSTYPE'))}
                              right: {(DQ (linux)) (Lit_Other '*')}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: (C {(command)} {(-v)} {(vlc)})
                              terminator: <Op_Amp '&'>
                            )
                            (Sentence
                              child: 
                                (SimpleCommand
                                  redirects: [
                                    (Redir
                                      op_id: Redir_Great
                                      fd: 16777215
                                      arg_word: {(/dev/null)}
                                      spids: [858]
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:player)
                                  op: Equal
                                  rhs: {(DQ (vlc))}
                                  spids: [864]
                                )
                              ]
                              spids: [864]
                            )
                          ]
                          spids: [16777215 861]
                        )
                        (if_arm
                          cond: [
                            (Sentence
                              child: (C {(command)} {(-v)} {(mpv)})
                              terminator: <Op_Amp '&'>
                            )
                            (Sentence
                              child: 
                                (SimpleCommand
                                  redirects: [
                                    (Redir
                                      op_id: Redir_Great
                                      fd: 16777215
                                      arg_word: {(/dev/null)}
                                      spids: [879]
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:player)
                                  op: Equal
                                  rhs: {(DQ (mpv))}
                                  spids: [885]
                                )
                              ]
                              spids: [885]
                            )
                          ]
                          spids: [870 882]
                        )
                        (if_arm
                          cond: [
                            (Sentence
                              child: (C {(command)} {(-v)} {(mplayer)})
                              terminator: <Op_Amp '&'>
                            )
                            (Sentence
                              child: 
                                (SimpleCommand
                                  redirects: [
                                    (Redir
                                      op_id: Redir_Great
                                      fd: 16777215
                                      arg_word: {(/dev/null)}
                                      spids: [900]
                                    )
                                  ]
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:player)
                                  op: Equal
                                  rhs: {(DQ (mplayer))}
                                  spids: [906]
                                )
                              ]
                              spids: [906]
                            )
                          ]
                          spids: [891 903]
                        )
                      ]
                      else_action: [
                        (SimpleCommand
                          words: [
                            {(echo)}
                            {
                              (DQ 
                                (
'Error: no supported video player installed (vlc, mpv or mplayer)'
                                )
                              )
                            }
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_GreatAnd
                              fd: 16777215
                              arg_word: {(2)}
                              spids: [921]
                            )
                          ]
                        )
                        (ControlFlow
                          token: <ControlFlow_Return return>
                          arg_word: {(1)}
                        )
                      ]
                      spids: [912 930]
                    )
                  ]
                  spids: [16777215 846]
                )
                (if_arm
                  cond: [
                    (Sentence
                      child: 
                        (DBracket
                          expr: 
                            (BoolBinary
                              op_id: BoolBinary_GlobDEqual
                              left: {(DQ ($ VSub_Name '$OSTYPE'))}
                              right: {(DQ (darwin)) (Lit_Other '*')}
                            )
                        )
                      terminator: <Op_Semi ';'>
                    )
                  ]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolUnary
                                      op_id: BoolUnary_f
                                      child: {(/Applications/VLC.app/Contents/MacOS/VLC)}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:player)
                                  op: Equal
                                  rhs: {(DQ (/Applications/VLC.app/Contents/MacOS/VLC))}
                                  spids: [967]
                                )
                              ]
                              spids: [967]
                            )
                          ]
                          spids: [16777215 964]
                        )
                      ]
                      else_action: [
                        (SimpleCommand
                          words: [
                            {(echo)}
                            {(DQ ('Error: vlc is not installed and it is required to play videos'))}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_GreatAnd
                              fd: 16777215
                              arg_word: {(2)}
                              spids: [982]
                            )
                          ]
                        )
                        (ControlFlow
                          token: <ControlFlow_Return return>
                          arg_word: {(1)}
                        )
                      ]
                      spids: [973 991]
                    )
                  ]
                  spids: [933 951]
                )
              ]
              spids: [16777215 994]
            )
          ]
          spids: [826]
        )
      spids: [822 825]
    )
    (FuncDef
      name: channelview
      body: 
        (BraceGroup
          children: [
            (AndOr
              children: [
                (C {(mkdir)} {(-p)} 
                  {($ VSub_Name '$HOME') (/.cache/ytview/channels/) ($ VSub_Name '$channel')}
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(httpGet)} 
                      {(https) (Lit_Other ':') (//www.youtube.com/user/) ($ VSub_Name '$channel') 
                        (/videos)
                      }
                    )
                    (C {(grep)} {(DQ (Duration))})
                    (C {(awk)} 
                      {
                        (SQ 
                          <
'{print $10 " " $11 " " $12 " " $13 " " $14 " " $15 " " $16 " " $17 " " $18 " " $19 " " $20 " " $21 " " $22 " " $23 " " $24 " " $25 " " $26 " " $27 " " $29}'
                          >
                        )
                      }
                    )
                    (C {(sed)} {(SQ <'s/aria-describedby="description-id.*//'>)})
                    (C {(sed)} {(s/title) (Lit_Other '=') (//)})
                    (C {(sed)} {(SQ <'s/"//'>)})
                    (C {(sed)} {(SQ <'s/"//'>)})
                    (C {(awk)} {(SQ <'{printf "%s.\\t%s\\n",NR,$0}'>)})
                    (C {(sed)} {(s/) (SQ <'&#39;'>) (/) (DQ ("'")) (/g)})
                    (SimpleCommand
                      words: [{(sed)} {(s/) (SQ <'&amp;'>) (/) (SQ <and>) (/g)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: 
                            {($ VSub_Name '$HOME') (/.cache/ytview/channels/) 
                              ($ VSub_Name '$channel') (/titles.txt)
                            }
                          spids: [1118]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(httpGet)} 
                      {(https) (Lit_Other ':') (//www.youtube.com/user/) ($ VSub_Name '$channel') 
                        (/Videos)
                      }
                    )
                    (C {(grep)} {(DQ ('watch?v='))})
                    (C {(awk)} {(SQ <'{print $6}'>)})
                    (C {(sed)} {(s/spf-link//)})
                    (C {(sed)} {(s/href) (Lit_Other '=') (//)})
                    (C {(sed)} {(SQ <'s/"//'>)})
                    (C {(sed)} {(SQ <'s/"//'>)})
                    (C {(sed)} {(SQ <'/^\\s*$/d'>)})
                    (C {(sed)} {(SQ <'s/\\//https:\\/\\/www.youtube.com\\//'>)})
                    (SimpleCommand
                      words: [{(awk)} {(SQ <'{printf "%s.\\t%s\\n",NR,$0}'>)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: 
                            {($ VSub_Name '$HOME') (/.cache/ytview/channels/) 
                              ($ VSub_Name '$channel') (/urls.txt)
                            }
                          spids: [1215]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(head)} {(-n)} {(20)} 
                  {($ VSub_Name '$HOME') (/.cache/ytview/channels/) ($ VSub_Name '$channel') 
                    (/titles.txt)
                  }
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
              ]
              op_id: Op_DPipe
            )
            (C {(read)} {(-p)} {(DQ ('Choose a video: '))} {(titlenumber)})
            (Sentence
              child: 
                (SimpleCommand
                  words: [
                    {($ VSub_Name '$player')}
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (SimpleCommand
                                    words: [
                                      {(sed)}
                                      {(-n)}
                                      {
                                        (CommandSubPart
                                          command_list: 
                                            (CommandList
                                              children: [(C {(echo)} {($ VSub_Name '$titlenumber')})]
                                            )
                                          left_token: <Left_CommandSub '$('>
                                          spids: [1282 1286]
                                        ) (p)
                                      }
                                    ]
                                    redirects: [
                                      (Redir
                                        op_id: Redir_Less
                                        fd: 16777215
                                        arg_word: 
                                          {($ VSub_Name '$HOME') (/.cache/ytview/channels/) 
                                            ($ VSub_Name '$channel') (/urls.txt)
                                          }
                                        spids: [1289]
                                      )
                                    ]
                                  )
                                  (C {(awk)} {(SQ <'{print $2}'>)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [1277 1303]
                      )
                    }
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(/dev/null)}
                      spids: [1305]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[1309])
                  ]
                )
              terminator: <Op_Amp '&'>
            )
          ]
          spids: [1007]
        )
      spids: [1003 1006]
    )
    (FuncDef
      name: searchview
      body: 
        (BraceGroup
          children: [
            (Assignment
              keyword: Assign_None
              pairs: [
                (assign_pair
                  lhs: (LhsName name:search)
                  op: Equal
                  rhs: 
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (C {(echo)} {($ VSub_Name '$search')})
                                  (C {(tr)} {(DQ (' '))} {(Lit_Other '+')})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [1326 1341]
                      )
                    }
                  spids: [1325]
                )
              ]
              spids: [1325]
            )
            (C {(mkdir)} {(-p)} 
              {($ VSub_Name '$HOME') (/.cache/ytview/searches/) ($ VSub_Name '$search')}
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(httpGet)} 
                      {(https) (Lit_Other ':') (//www.youtube.com/results) 
                        (EscapedLiteralPart token:<Lit_EscapedChar '\\?'>) (search_query) (EscapedLiteralPart token:<Lit_EscapedChar '\\='>) ($ VSub_Name '$search')
                      }
                    )
                    (C {(grep)} {(DQ (Duration))})
                    (C {(grep)} {(DQ ('watch?v='))})
                    (C {(awk)} 
                      {
                        (SQ 
                          <
'{print $13 " " $14 " " $15 " " $16 " " $17 " " $18 " " $19 " " $20 " " $21 " " $22 " " $23 " " $23}'
                          >
                        )
                      }
                    )
                    (C {(sed)} {(SQ <'s/aria-describedby="description-id.*//g'>)})
                    (C {(sed)} {(s/title) (Lit_Other '=') (//)})
                    (C {(sed)} {(SQ <'s/"//g'>)})
                    (C {(sed)} {(s/spf-link//)})
                    (C {(sed)} {(SQ <'s/data-session-link=itct*.//'>)})
                    (C {(sed)} {(s/spf-prefetch//g)})
                    (C {(sed)} {(SQ <'s/rel=//g'>)})
                    (C {(sed)} {(SQ <'s/"//'>)})
                    (C {(awk)} {(SQ <'{printf "%s.\\t%s\\n",NR,$0}'>)})
                    (C {(sed)} {(s/) (SQ <'&#39;'>) (/) (DQ ("'")) (/g)})
                    (SimpleCommand
                      words: [{(sed)} {(s/) (SQ <'&amp;'>) (/) (SQ <and>) (/g)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: 
                            {($ VSub_Name '$HOME') (/.cache/ytview/searches/) ($ VSub_Name '$search') 
                              (/titles.txt)
                            }
                          spids: [1487]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (Pipeline
                  children: [
                    (C {(httpGet)} 
                      {(https) (Lit_Other ':') (//www.youtube.com/results) 
                        (EscapedLiteralPart token:<Lit_EscapedChar '\\?'>) (search_query) (EscapedLiteralPart token:<Lit_EscapedChar '\\='>) ($ VSub_Name '$search')
                      }
                    )
                    (C {(grep)} {(DQ ('watch?v='))})
                    (C {(awk)} {(SQ <'{print $5}'>)})
                    (C {(sed)} {(s/vve-check//)})
                    (C {(sed)} {(SQ <'s/href="/https:\\/\\/www.youtube.com/'>)})
                    (C {(sed)} {(SQ <'s/"//'>)})
                    (C {(sed)} {(s/class) (Lit_Other '=') (DQ (yt-uix-tile-link)) (//)})
                    (C {(sed)} {(SQ <'/^\\s*$/d'>)})
                    (SimpleCommand
                      words: [{(awk)} {(SQ <'{printf "%s.\\t%s\\n",NR,$0}'>)}]
                      redirects: [
                        (Redir
                          op_id: Redir_Great
                          fd: 16777215
                          arg_word: 
                            {($ VSub_Name '$HOME') (/.cache/ytview/searches/) ($ VSub_Name '$search') 
                              (/urls.txt)
                            }
                          spids: [1580]
                        )
                      ]
                    )
                  ]
                  negated: False
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
              ]
              op_id: Op_DPipe
            )
            (AndOr
              children: [
                (C {(cat)} 
                  {($ VSub_Name '$HOME') (/.cache/ytview/searches/) ($ VSub_Name '$search') 
                    (/titles.txt)
                  }
                )
                (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)})
              ]
              op_id: Op_DPipe
            )
            (C {(read)} {(-p)} {(DQ ('Choose a video: '))} {(titlenumber)})
            (Sentence
              child: 
                (SimpleCommand
                  words: [
                    {($ VSub_Name '$player')}
                    {
                      (CommandSubPart
                        command_list: 
                          (CommandList
                            children: [
                              (Pipeline
                                children: [
                                  (SimpleCommand
                                    words: [
                                      {(sed)}
                                      {(-n)}
                                      {
                                        (CommandSubPart
                                          command_list: 
                                            (CommandList
                                              children: [(C {(echo)} {($ VSub_Name '$titlenumber')})]
                                            )
                                          left_token: <Left_CommandSub '$('>
                                          spids: [1640 1644]
                                        ) (p)
                                      }
                                    ]
                                    redirects: [
                                      (Redir
                                        op_id: Redir_Less
                                        fd: 16777215
                                        arg_word: 
                                          {($ VSub_Name '$HOME') (/.cache/ytview/searches/) 
                                            ($ VSub_Name '$search') (/urls.txt)
                                          }
                                        spids: [1647]
                                      )
                                    ]
                                  )
                                  (C {(awk)} {(SQ <'{print $2}'>)})
                                ]
                                negated: False
                              )
                            ]
                          )
                        left_token: <Left_CommandSub '$('>
                        spids: [1635 1661]
                      )
                    }
                  ]
                  redirects: [
                    (Redir
                      op_id: Redir_Great
                      fd: 16777215
                      arg_word: {(/dev/null)}
                      spids: [1663]
                    )
                    (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[1667])
                  ]
                )
              terminator: <Op_Amp '&'>
            )
          ]
          spids: [1321]
        )
      spids: [1317 1320]
    )
    (FuncDef
      name: usage
      body: 
        (BraceGroup
          children: [
            (C {(echo)} {(DQ (Ytview))})
            (C {(echo)} {(DQ ('Description: Search and play youtube videos right from the terminal.'))})
            (C {(echo)} {(DQ ('Usage: ytview [flag] [string] or ytview [videoToSearch]'))})
            (C {(echo)} {(DQ ('  -s Searches youtube'))})
            (C {(echo)} {(DQ ('  -c Shows the latest videos of a channel'))})
            (C {(echo)} {(DQ ('  -u Update Bash-Snippet Tools'))})
            (C {(echo)} {(DQ ('  -h Show the help'))})
            (C {(echo)} {(DQ ('  -v Get the tool version'))})
            (C {(echo)} {(DQ ('Examples:'))})
            (C {(echo)} {(DQ ('  ytview -s Family Guy Chicken Fight'))})
            (C {(echo)} {(DQ ('  ytview -c Numberphile'))})
          ]
          spids: [1682]
        )
      spids: [1678 1681]
    )
    (AndOr children:[(C {(getConfiguredClient)}) (C {(exit)} {(1)})] op_id:Op_DPipe)
    (AndOr children:[(C {(getConfiguredPlayer)}) (C {(exit)} {(1)})] op_id:Op_DPipe)
    (AndOr children:[(C {(checkInternet)}) (C {(exit)} {(1)})] op_id:Op_DPipe)
    (While
      cond: [
        (C {(getopts)} {(vuc) (Lit_Other ':') (s) (Lit_Other ':') (h) (Lit_Other '*') (Lit_Other ':')} 
          {(option)}
        )
      ]
      body: 
        (DoGroup
          children: [
            (Case
              to_match: {(DQ (${ VSub_Name option))}
              arms: [
                (case_arm
                  pat_list: [{(s)}]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_GlobNEqual
                                      left: {($ VSub_Name '$flag')}
                                      right: {(DQ (channel))}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:search)
                                  op: Equal
                                  rhs: 
                                    {
                                      (CommandSubPart
                                        command_list: 
                                          (CommandList
                                            children: [
                                              (C {(printf)} {(SQ <'%s '>)} {(DQ ($ VSub_At '$@'))})
                                            ]
                                          )
                                        left_token: <Left_CommandSub '$('>
                                        spids: [1839 1849]
                                      )
                                    }
                                  spids: [1838]
                                )
                              ]
                              spids: [1838]
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:flag)
                                  op: Equal
                                  rhs: {(DQ (search))}
                                  spids: [1852]
                                )
                              ]
                              spids: [1852]
                            )
                          ]
                          spids: [16777215 1835]
                        )
                      ]
                      else_action: [
                        (SimpleCommand
                          words: [
                            {(echo)}
                            {(DQ ('Error: search and channel options are mutually exclusive'))}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_GreatAnd
                              fd: 16777215
                              arg_word: {(2)}
                              spids: [1867]
                            )
                          ]
                        )
                        (C {(exit)} {(1)})
                      ]
                      spids: [1858 1876]
                    )
                  ]
                  spids: [1817 1818 1879 16777215]
                )
                (case_arm
                  pat_list: [{(c)}]
                  action: [
                    (If
                      arms: [
                        (if_arm
                          cond: [
                            (Sentence
                              child: 
                                (DBracket
                                  expr: 
                                    (BoolBinary
                                      op_id: BoolBinary_GlobNEqual
                                      left: {($ VSub_Name '$flag')}
                                      right: {(DQ (search))}
                                    )
                                )
                              terminator: <Op_Semi ';'>
                            )
                          ]
                          action: [
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:channel)
                                  op: Equal
                                  rhs: {(DQ ($ VSub_Name '$OPTARG'))}
                                  spids: [1903]
                                )
                              ]
                              spids: [1903]
                            )
                            (Assignment
                              keyword: Assign_None
                              pairs: [
                                (assign_pair
                                  lhs: (LhsName name:flag)
                                  op: Equal
                                  rhs: {(DQ (channel))}
                                  spids: [1909]
                                )
                              ]
                              spids: [1909]
                            )
                          ]
                          spids: [16777215 1900]
                        )
                      ]
                      else_action: [
                        (SimpleCommand
                          words: [
                            {(echo)}
                            {(DQ ('Error: search and channel options are mutually exclusive'))}
                          ]
                          redirects: [
                            (Redir
                              op_id: Redir_GreatAnd
                              fd: 16777215
                              arg_word: {(2)}
                              spids: [1924]
                            )
                          ]
                        )
                        (C {(exit)} {(1)})
                      ]
                      spids: [1915 1933]
                    )
                  ]
                  spids: [1882 1883 1936 16777215]
                )
                (case_arm
                  pat_list: [{(h)}]
                  action: [(AndOr children:[(C {(usage)}) (C {(exit)} {(0)})] op_id:Op_DAmp)]
                  spids: [1939 1940 1950 16777215]
                )
                (case_arm
                  pat_list: [{(u)}]
                  action: [(AndOr children:[(C {(update)}) (C {(exit)} {(0)})] op_id:Op_DAmp)]
                  spids: [1953 1954 1964 16777215]
                )
                (case_arm
                  pat_list: [{(v)}]
                  action: [
                    (AndOr
                      children: [
                        (C {(echo)} {(DQ ('Version ') ($ VSub_Name '$currentVersion'))})
                        (C {(exit)} {(0)})
                      ]
                      op_id: Op_DAmp
                    )
                  ]
                  spids: [1967 1968 1983 16777215]
                )
                (case_arm
                  pat_list: [{(Lit_Other '*')}]
                  action: [(AndOr children:[(C {(usage)}) (C {(exit)} {(0)})] op_id:Op_DAmp)]
                  spids: [1986 1987 1997 16777215]
                )
              ]
              spids: [1806 1814 2000]
            )
          ]
          spids: [1803 2002]
        )
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: {($ VSub_Pound '$#')}
                      right: {(DQ (0))}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(usage)}) (C {(exit)} {(0)})]
          spids: [16777215 2020]
        )
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: {($ VSub_Number '$1')}
                      right: {(DQ (help))}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(usage)}) (C {(exit)} {(0)})]
          spids: [2030 2044]
        )
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: {($ VSub_Number '$1')}
                      right: {(DQ (update))}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(C {(update)}) (C {(exit)} {(0)})]
          spids: [2054 2069]
        )
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: {($ VSub_Name '$flag')}
                      right: {(DQ (search))}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(AndOr children:[(C {(searchview)}) (C {(exit)} {(1)})] op_id:Op_DPipe)]
          spids: [2079 2094]
        )
        (if_arm
          cond: [
            (Sentence
              child: 
                (DBracket
                  expr: 
                    (BoolBinary
                      op_id: BoolBinary_GlobDEqual
                      left: {($ VSub_Name '$flag')}
                      right: {(DQ (channel))}
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [(AndOr children:[(C {(channelview)}) (C {(exit)} {(1)})] op_id:Op_DPipe)]
          spids: [2105 2120]
        )
      ]
      else_action: [
        (Assignment
          keyword: Assign_None
          pairs: [
            (assign_pair
              lhs: (LhsName name:search)
              op: Equal
              rhs: 
                {
                  (CommandSubPart
                    command_list: 
                      (CommandList
                        children: [(C {(printf)} {(SQ <'%s '>)} {(DQ ($ VSub_At '$@'))})]
                      )
                    left_token: <Left_CommandSub '$('>
                    spids: [2135 2145]
                  )
                }
              spids: [2134]
            )
          ]
          spids: [2134]
        )
        (AndOr children:[(C {(searchview)}) (C {(exit)} {(1)})] op_id:Op_DPipe)
      ]
      spids: [2131 2156]
    )
  ]
)