(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: (SimpleCommand words: [{(command)} {(-v)} {(curl)}] redirects: [ (Redir op: <Redir_AndGreat '&>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredClient) op: Equal rhs: {(DQ (curl))} spids: [78] ) ] spids: [78] ) ] spids: [16777215 75] ) (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(command)} {(-v)} {(wget)}] redirects: [ (Redir op: <Redir_AndGreat '&>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredClient) op: Equal rhs: {(DQ (wget))} spids: [100] ) ] spids: [100] ) ] spids: [84 97] ) (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(command)} {(-v)} {(fetch)}] redirects: [ (Redir op: <Redir_AndGreat '&>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:configuredClient) op: Equal rhs: {(DQ (fetch))} spids: [122] ) ] spids: [122] ) ] spids: [106 119] ) ] else_action: [ (SimpleCommand words: [ {(echo)} {(DQ ('Error: This tool reqires either curl, wget, or fetch to be installed.'))} ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [128 146] ) ] 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:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)}) (Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) ] negated: F ) (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 202] ) ] else_action: [ (SimpleCommand words: [{(echo)} {(DQ ('Error: no active internet connection'))}] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] spids: [213 234] ) ] spids: [155] ) spids: [151 154] ) (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: [258 259 272 16777215] ) (case_arm pat_list: [{(wget)}] action: [(C {(wget)} {(-qO-)} {(DQ ($ VSub_At '$@'))})] spids: [275 276 285 16777215] ) (case_arm pat_list: [{(fetch)}] action: [(C {(fetch)} {(-o)} {(DQ (...))})] spids: [288 289 298 16777215] ) ] spids: [249 255 301] ) ] spids: [246] ) spids: [242 245] ) (FuncDef name: update body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:repositoryName) op: Equal rhs: {(DQ (Bash-Snippets))} spids: [325] ) ] spids: [325] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:githubUserName) op: Equal rhs: {(DQ (alexanderepstein))} spids: [334] ) ] spids: [334] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:nameOfInstallFile) op: Equal rhs: {(DQ (install.sh))} spids: [343] ) ] spids: [343] ) (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: F ) ] ) left_token: <Left_CommandSub '$('> spids: [353 389] ) } spids: [352] ) ] spids: [352] ) (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:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [16777215 436] ) (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:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] spids: [454 467] ) ] 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 ops: [Op_DPipe] children: [ (C {(cd)} {(TildeSubPart token:<Lit_TildeLike '~'>)}) (BraceGroup children: [ (Sentence child: (C {(echo)} {(SQ <'Update Failed'>)}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [573] ) ] ) (If arms: [ (if_arm cond: [ (Sentence child: (DBracket expr: (BoolUnary op_id: BoolUnary_d child: {(Lit_TildeLike '~') (/) ($ VSub_Name '$repositoryName') } ) ) terminator: <Op_Semi ';'> ) ] action: [ (Sentence child: (AndOr ops: [Op_DPipe] 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: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [617] ) ] ) terminator: <Op_Semi ';'> ) ] spids: [16777215 605] ) ] spids: [16777215 635] ) (AndOr ops: [Op_DPipe] 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: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [651] ) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(cd)} {($ VSub_Name '$repositoryName')}) (BraceGroup children: [ (Sentence child: (C {(echo)} {(SQ <'Update Failed'>)}) terminator: <Op_Semi ';'> ) (Sentence child: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [675] ) ] ) (AndOr ops: [Op_DPipe Op_DPipe] children: [ (SimpleCommand words: [ {(git)} {(checkout)} {(DQ (v) ($ VSub_Name '$latestVersion'))} ] redirects: [ (Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(/dev/null)} ) ] ) (SimpleCommand words: [{(git)} {(checkout)} {(DQ ($ VSub_Name '$latestVersion'))}] redirects: [ (Redir op: <Redir_Great '2>'> fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(echo)} { (DQ ( "Couldn't git checkout to stable release, updating to latest commit." ) ) } ) ] ) (C {(chmod)} {(a) (Lit_Other '+') (x)} {(install.sh)}) (AndOr ops: [Op_DPipe] children: [ (C {(./) ($ VSub_Name '$nameOfInstallFile')} {(DQ (update))}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] ) (C {(cd)} {(..)}) (AndOr ops: [Op_DPipe] 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: (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) terminator: <Op_Semi ';'> ) ] spids: [770] ) ] ) ] spids: [16777215 564] ) ] else_action: [(ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] spids: [789 797] ) ] spids: [16777215 505] ) ] else_action: [ (C {(echo)} {(DQ ($ VSub_Name '$repositoryName') (' is already the latest version'))} ) ] spids: [800 811] ) ] spids: [485 814] ) ] spids: [310] ) spids: [306 309] ) (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: (SimpleCommand words: [{(command)} {(-v)} {(vlc)}] redirects: [ (Redir op: <Redir_AndGreat '&>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:player) op: Equal rhs: {(DQ (vlc))} spids: [860] ) ] spids: [860] ) ] spids: [16777215 857] ) (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(command)} {(-v)} {(mpv)}] redirects: [ (Redir op: <Redir_AndGreat '&>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:player) op: Equal rhs: {(DQ (mpv))} spids: [880] ) ] spids: [880] ) ] spids: [866 877] ) (if_arm cond: [ (Sentence child: (SimpleCommand words: [{(command)} {(-v)} {(mplayer)}] redirects: [ (Redir op: <Redir_AndGreat '&>'> fd: 16777215 arg_word: {(/dev/null)} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:player) op: Equal rhs: {(DQ (mplayer))} spids: [900] ) ] spids: [900] ) ] spids: [886 897] ) ] else_action: [ (SimpleCommand words: [ {(echo)} { (DQ ( 'Error: no supported video player installed (vlc, mpv or mplayer)' ) ) } ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] spids: [906 924] ) ] spids: [16777215 843] ) (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: [961] ) ] spids: [961] ) ] spids: [16777215 958] ) ] else_action: [ (SimpleCommand words: [ {(echo)} {(DQ ('Error: vlc is not installed and it is required to play videos'))} ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token: <ControlFlow_Return return> arg_word: {(1)} ) ] spids: [967 985] ) ] spids: [927 945] ) ] spids: [16777215 988] ) ] spids: [823] ) spids: [819 822] ) (FuncDef name: channelview body: (BraceGroup children: [ (AndOr ops: [Op_DPipe] children: [ (C {(mkdir)} {(-p)} {($ VSub_Name '$HOME') (/.cache/ytview/channels/) ($ VSub_Name '$channel')} ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] 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 <'''>) (/) (DQ ("'")) (/g)}) (SimpleCommand words: [{(sed)} {(s/) (SQ <'&'>) (/) (SQ <and>) (/g)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {($ VSub_Name '$HOME') (/.cache/ytview/channels/) ($ VSub_Name '$channel') (/titles.txt) } ) ] ) ] negated: F ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] 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: <Redir_Great '>'> fd: 16777215 arg_word: {($ VSub_Name '$HOME') (/.cache/ytview/channels/) ($ VSub_Name '$channel') (/urls.txt) } ) ] ) ] negated: F ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(head)} {(-n)} {(20)} {($ VSub_Name '$HOME') (/.cache/ytview/channels/) ($ VSub_Name '$channel') (/titles.txt) } ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (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: [1276 1280] ) (p) } ] redirects: [ (Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {($ VSub_Name '$HOME') (/.cache/ytview/channels/) ($ VSub_Name '$channel') (/urls.txt) } ) ] ) (C {(awk)} {(SQ <'{print $2}'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1271 1297] ) } ] redirects: [ (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)}) (Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) terminator: <Op_Amp '&'> ) ] spids: [1001] ) spids: [997 1000] ) (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: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1320 1335] ) } spids: [1319] ) ] spids: [1319] ) (C {(mkdir)} {(-p)} {($ VSub_Name '$HOME') (/.cache/ytview/searches/) ($ VSub_Name '$search')} ) (AndOr ops: [Op_DPipe] 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 <'''>) (/) (DQ ("'")) (/g)}) (SimpleCommand words: [{(sed)} {(s/) (SQ <'&'>) (/) (SQ <and>) (/g)}] redirects: [ (Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {($ VSub_Name '$HOME') (/.cache/ytview/searches/) ($ VSub_Name '$search') (/titles.txt) } ) ] ) ] negated: F ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] 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: <Redir_Great '>'> fd: 16777215 arg_word: {($ VSub_Name '$HOME') (/.cache/ytview/searches/) ($ VSub_Name '$search') (/urls.txt) } ) ] ) ] negated: F ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (AndOr ops: [Op_DPipe] children: [ (C {(cat)} {($ VSub_Name '$HOME') (/.cache/ytview/searches/) ($ VSub_Name '$search') (/titles.txt) } ) (ControlFlow token:<ControlFlow_Return return> arg_word:{(1)}) ] ) (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: [1634 1638] ) (p) } ] redirects: [ (Redir op: <Redir_Less '<'> fd: 16777215 arg_word: {($ VSub_Name '$HOME') (/.cache/ytview/searches/) ($ VSub_Name '$search') (/urls.txt) } ) ] ) (C {(awk)} {(SQ <'{print $2}'>)}) ] negated: F ) ] ) left_token: <Left_CommandSub '$('> spids: [1629 1655] ) } ] redirects: [ (Redir op:<Redir_Great '>'> fd:16777215 arg_word:{(/dev/null)}) (Redir op:<Redir_GreatAnd '2>&'> fd:2 arg_word:{(1)}) ] ) terminator: <Op_Amp '&'> ) ] spids: [1315] ) spids: [1311 1314] ) (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: [1676] ) spids: [1672 1675] ) (AndOr ops: [Op_DPipe] children: [(C {(getConfiguredClient)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) (AndOr ops: [Op_DPipe] children: [(C {(getConfiguredPlayer)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) (AndOr ops: [Op_DPipe] children: [(C {(checkInternet)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) (WhileUntil keyword: <KW_While 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: [1833 1843] ) } spids: [1832] ) ] spids: [1832] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:flag) op: Equal rhs: {(DQ (search))} spids: [1846] ) ] spids: [1846] ) ] spids: [16777215 1829] ) ] else_action: [ (SimpleCommand words: [ {(echo)} {(DQ ('Error: search and channel options are mutually exclusive'))} ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] spids: [1852 1870] ) ] spids: [1811 1812 1873 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: [1897] ) ] spids: [1897] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:flag) op: Equal rhs: {(DQ (channel))} spids: [1903] ) ] spids: [1903] ) ] spids: [16777215 1894] ) ] else_action: [ (SimpleCommand words: [ {(echo)} {(DQ ('Error: search and channel options are mutually exclusive'))} ] redirects: [(Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(1)} ) ] spids: [1909 1927] ) ] spids: [1876 1877 1930 16777215] ) (case_arm pat_list: [{(h)}] action: [ (AndOr ops: [Op_DAmp] children: [ (C {(usage)}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(0)} ) ] ) ] spids: [1933 1934 1944 16777215] ) (case_arm pat_list: [{(u)}] action: [ (AndOr ops: [Op_DAmp] children: [ (C {(update)}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(0)} ) ] ) ] spids: [1947 1948 1958 16777215] ) (case_arm pat_list: [{(v)}] action: [ (AndOr ops: [Op_DAmp] children: [ (C {(echo)} {(DQ ('Version ') ($ VSub_Name '$currentVersion'))}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(0)} ) ] ) ] spids: [1961 1962 1977 16777215] ) (case_arm pat_list: [{(Lit_Other '*')}] action: [ (AndOr ops: [Op_DAmp] children: [ (C {(usage)}) (ControlFlow token: <ControlFlow_Exit exit> arg_word: {(0)} ) ] ) ] spids: [1980 1981 1991 16777215] ) ] spids: [1800 1808 1994] ) ] spids: [1797 1996] ) ) (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)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [16777215 2014] ) (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)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [2024 2038] ) (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)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(0)})] spids: [2048 2063] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$flag')} right: {(DQ (search))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (AndOr ops: [Op_DPipe] children: [(C {(searchview)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) ] spids: [2073 2088] ) (if_arm cond: [ (Sentence child: (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: {($ VSub_Name '$flag')} right: {(DQ (channel))} ) ) terminator: <Op_Semi ';'> ) ] action: [ (AndOr ops: [Op_DPipe] children: [(C {(channelview)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) ] spids: [2099 2114] ) ] 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: [2129 2139] ) } spids: [2128] ) ] spids: [2128] ) (AndOr ops: [Op_DPipe] children: [(C {(searchview)}) (ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)})] ) ] spids: [2125 2150] ) ] )