Skip to content

Commit

Permalink
feat: v3 (#727)
Browse files Browse the repository at this point in the history
* refactor: extracted the UI into a separate file
feat: updating UI with main program
feat: announcing UI version and theme with program version

* chore: shellcheck -x to follow the sourced file

* chore: whitespaces

* feat:changed source to animixplay

* fix: shell check

* fix: always include the UI relative to the script

* chore: tyding up

* chore: formatting

* change: better interface for menus

* feat:add allanime server parsing

* choke: shellcheck

* fix: history parsing

* choke: shellcheck uwu

* feat: exclude jq dependency

* fix:optimizations

* fix:excluding extra episode

* feat: debug option, more verbose script

* fix: optimizations

* fix: shellcheck compliance for UI
improvemet: made prompt more polished

* fix: unset `$result_links` even if debug doesn't exist

* feat:argument to use gogoanime direct links only..

* qa: removed unnecessary variable: IFS

* refactor: moved `update_ui` and `ui_version_text`

* qa: broke up long lines

* qa: optimized and clarified provider selection

* qa: removed unnecessary variable `video_links`

* fix: fetch providers with indexes lower than the default

* choke: call to nonexistent function

* qa: trimmed down `append`

* "version bump" :)

* qa: removal of boilerplate

* feat:animixplay direct links provider

* feat:animixplay direct links provider

* choke:shellcheck

* docs: android referrer and pkg up (#739)

* choke: android referrer

* docs: termux pkg up (#737)

Fix for #735

Co-authored-by: ivan <[email protected]>
Co-authored-by: C0ff33W1thB4c0n <[email protected]>

* docs: android only audio

* feat:I don't know what to say

* feat: iina as MacOS default (#742)

* set iina as default for MacOS instead of mpv

* little doc update [that i accidentally removed 💀]

* ostype -> uname [posix compliance]

* readme conflict

* resolve readme conflict

* small .md err

* small .md update

* added uninsatll commands for linux & osx

* nice-to-have:preamble to the end
refactor: started to factor out the player functionality

* m3u8 resolution parsing

* refactor: mpv implementation of `play_episode`

* refactor: iina implementation of `play_episode`

* refactor: syncplay implementation of `play_episode`

* refactor: vlc implementation of `play_episode`

* screwed up the merge, backing up...

* feat:fast and asynchronous m3u8 downloading

* choke: shellcheck

* refactor: better dep_ch
feature: `player_download` script

* refactor: downloading is done by `player_download`
refactor: moved download related setup to `player_download`
fix: conforming with the new m3u8 parsing
refactor: playing/downloading messages moved to player scripts

* fix: updated download at it's place

* qa: removed preamble from daughter scripts

* qa: universal updater for every file

* choke: bad regex, files moved

* fix: shellcheck
note: export in `player_download` is only required by shellcheck because it doesn't check conditionally sourced files

* qa: spaces and other elegance things
qa: identifying comments to the m3u8 download scheme

* qa: shorter m3u8 quality selection
fix: if set quality isn't found, only the current ep will play on best

* fix: shellcheck (pls for the last time)

* fix:no video_url in m3u8

* fix:background jobs checking

* qa:select provider, refactoring

* qa: whitespaces and useless ocd changes

Co-authored-by: CoolnsX <[email protected]>
Co-authored-by: chokerman <[email protected]>
Co-authored-by: ivan <[email protected]>
Co-authored-by: C0ff33W1thB4c0n <[email protected]>
Co-authored-by: Person <[email protected]>
  • Loading branch information
6 people authored Jun 13, 2022
1 parent 6a0fa9c commit 581d30f
Show file tree
Hide file tree
Showing 9 changed files with 475 additions and 342 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -s sh -o all -e 2250
SHELLCHECK_OPTS: -s sh -o all -e 2250 -x
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ https://user-images.githubusercontent.com/44473782/160729779-41fe207c-b5aa-4fed-
- [Fixing errors](#Fixing-errors)
- [Install](#Installation)
- [Arch](#Arch)
- [Linux & Mac OS](#linux--mac-os)
- [Linux](#Linux)
- [MacOs](#MacOS)
- [Windows](#Windows)
- [Android](#Android)
- [Uninstall](#Uninstall)
Expand Down Expand Up @@ -71,7 +72,7 @@ yay -S ani-cli

[![Packaging status](https://repology.org/badge/vertical-allrepos/ani-cli.svg)](https://repology.org/project/ani-cli/versions)

### Linux & Mac OS
### Linux

Install dependencies [(See below)](#Dependencies)

Expand All @@ -82,12 +83,24 @@ sudo chmod +x /usr/local/bin/ani-cli

*Note that mpv installed through flatpak is not compatible*

*To install (with Homebrew) the dependencies required on Mac OS, you can run:*
### MacOS

Install dependencies [(See below)](#Dependencies)

Install [HomeBrew](https://docs.brew.sh/Installation) if not installed.

```sh
brew install curl grep aria2 mpv [email protected] ffmpeg git
curl -sL github.com/pystardust/ani-cli/raw/master/ani-cli -o "$(brew --prefix)/bin/ani-cli"
chmod +x "$(brew --prefix)/bin/ani-cli"
```

*To install (with Homebrew) the dependencies required on Mac OS, you can run:*

```sh
brew install curl grep aria2 iina [email protected] ffmpeg git
```
*Why iina and not mpv? Drop-in replacement for mpv for MacOS. Integrates well with OSX UI. Excellent support for M1. Open Source.*

### Windows

*Note that the installation instruction below must be done inside
Expand Down Expand Up @@ -123,11 +136,17 @@ Make sure to update your packages:
pkg up
```

In the case mpv only plays audio, you can try running this command:
```sh
echo 'am start --user 0 -a android.intent.action.VIEW -d "$1" -n is.xyz.mpv/.MPVActivity' > $PREFIX/bin/mpv
```


## Uninstall

* Arch Linux: ```yay -R ani-cli```
* Other Linux: Just remove the thing from path
* Mac: Just remove the thing from path
* Other Linux: ```sudo rm /usr/local/bin/ani-cli```
* Mac: ```rm "$(brew --prefix)/bin/ani-cli"```
* Windows: ```scoop uninstall ani-cli```
* Android: Just remove the thing from path

Expand All @@ -139,6 +158,7 @@ pkg up
- curl
- openssl
- mpv - Video Player
- iina - mpv replacement for MacOS
- aria2 - Download manager
- ffmpeg - m3u8 Downloader

Expand Down
59 changes: 59 additions & 0 deletions UI
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/sh

UI_VERSION="1.0.0"
UI_NAME="classic"

ui_version_text() {
inf "UI theme: $UI_NAME"
inf "UI Version: $UI_VERSION"
}

retry () {
err "$*"
prompt
}

# display an error message to stderr (in red)
err () {
printf "\33[2K\r\033[1;31m%s\033[0m\n" "$*" >&2
}

# display an informational message (first argument in green, second in magenta)
inf () {
printf "\33[2K\r\033[1;35m%s \033[1;35m%s\033[0m\n" "$1" "$2"
}

progress() {
printf "\33[2K\r\033[1;34m%s\033[0m" "$1"
}

debug () {
printf "\n\033[1;32mReferrer :\033[0m %s\n\033[1;32mlinks >>\n\033[0m%s\n" "$1" "$2"
}

# prompts the user with message in $1-2 ($1 in blue, $2 in magenta) and saves the input to the variables in $REPLY and $REPLY2
prompt () {
[ -n "$*" ] && printf "\33[2K\r\033[1;35m%s\n" "$*"
printf "\033[1;35m> \033[0m"
read -r REPLY REPLY2
}

selection_menu() {
menu_line_parity=0
while read -r option line; do
if [ "$option" = "q" ]; then
printf "\033[1;31m(\033[1;31m%s\033[1;31m) \033[1;31m%s\033[0m\n" "$option" "$line"
else
if [ "$menu_line_parity" -eq 0 ]; then
printf "\033[1;33m(\033[1;33m%s\033[1;33m) \033[1;33m%s\033[0m\n" "$option" "$line"
menu_line_parity=1
else
printf "\033[1;36m(\033[1;36m%s\033[1;36m) \033[1;36m%s\033[0m\n" "$option" "$line"
menu_line_parity=0
fi
fi
done <<-EOF
$*
EOF
prompt
}
Loading

0 comments on commit 581d30f

Please sign in to comment.