Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
pystardust authored Jun 25, 2021
2 parents 86a2c6b + 44736ab commit 7cc9fdc
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 11 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
PREFIX = /usr/local/bin
endif
ifeq ($(UNAME), FreeBSD)
PREFIX = /usr/local/bin
endif
ifeq ($(UNAME), Linux)
PREFIX = /usr/bin
endif
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ first hit Q to save position and quit mpv, then choose your format using_

## Bugs

* _dwm with swallow patch: Images don't render when looped (ie, option -l)_
* _dwm with swallow patch: Images don't render when looped (ie, option `-l`)_
- _If thumbnails are not working `.Xauthority` might be causing it. Try deleting `.Xauthority` and relogging._
29 changes: 26 additions & 3 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ _Fzf is optional, you can use an external menu (like dmenu) with the `-D` option
* [`mpv`](https://github.com/mpv-player/mpv)
* [`youtube-dl`](https://github.com/ytdl-org/youtube-dl)
* [`jq`](https://github.com/stedolan/jq) - _to parse json_
* [`fzf`](https://github.com/junegunn/fzf) (Optional) - _for menu_
* [`fzf`](https://github.com/junegunn/fzf) (Optional if using: `dmenu, rofi`) - _for menu_
* [`notify-send`](https://gitlab.gnome.org/GNOME/libnotify) (Optional) - _for desktop notifications_
* [GNU `shuf`](https://www.gnu.org/software/coreutils/manual/html_node/shuf-invocation.html) or [ISC `shuf`](https://github.com/ibara/shuf) (Optional) - _for selecting random videos_
* [`ueberzug`](https://github.com/seebye/ueberzug) (Optional) - _for thumbnails_
* other thumbnail options
* [`chafa`](https://github.com/hpjansson/chafa)
Expand Down Expand Up @@ -35,6 +37,15 @@ _Fzf is optional, you can use an external menu (like dmenu) with the `-D` option

_Note youtube-dl is usually outdated in debian repos, I suggest getting it from [youtube-dl github](https://github.com/ytdl-org/youtube-dl)_

+ #### FreeBSD

pkg install jq mpv youtube_dl fzf libnotify shuf

> For thumbnails

pkg install --glob "py3*-ueberzug"


+ #### MacOS

brew install jq mpv youtube-dl fzf
Expand All @@ -53,15 +64,27 @@ _Fzf is optional, you can use an external menu (like dmenu) with the `-D` option

_MacOS users might need to change their installation path from `/usr/bin/` to `/usr/local/bin/`_

2. #### Arch users can install ytfzf from the [AUR](https://aur.archlinux.org/packages/ytfzf-git/)
2. #### Arch users can install ytfzf from the [AUR](https://aur.archlinux.org/packages/ytfzf/)

```
yay -S ytfzf
```

Or alternatively from [@JojiiOfficials](https://github.com/JojiiOfficial) [pacman repository](https://repo.jojii.de)

3. #### Gentoo users can install ytfzf from the [nitratesky](https://github.com/VTimofeenko/nitratesky) overlay
3. #### FreeBSD users can install ytfzf as a binary package with [pkg(8)](https://www.freshports.org/multimedia/ytfzf/)

```
pkg instal ytfzf
```

Or alternatively, build the port from source

```
make -C /usr/ports/multimedia/ytfzf install
```

4. #### Gentoo users can install ytfzf from the [nitratesky](https://github.com/VTimofeenko/nitratesky) overlay

```
eselect repository enable nitratesky
Expand Down
3 changes: 3 additions & 0 deletions docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,9 @@ https://www.youtube.com/c/MentalOutlaw/videos # mental outlaw
# Defaults to 10 results from each channel
ytfzf -S

# Sort subscriptions by upload date
ytfzf -S --sort

# To show 15 results instead
ytfzf --subs=15
```
Expand Down
29 changes: 27 additions & 2 deletions docs/conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ video_player="mpv"
#(YTFZF_PLAYER_FORMAT)
video_player_format="mpv --ytdl-format="

# this emulates the -m flag if set to 1
is_audio_only=0
#the player to use for audio ( option -m )
#(YTFZF_AUDIO_PLAYER)
audio_player="mpv --no-video"
Expand Down Expand Up @@ -129,6 +127,20 @@ is_ext_menu=0
#same as -t
show_thumbnails=0

#which quality thumbnails to use
#1: better thumbnails (slower)
#0: low resolution (faster)
#same as --thumbnail-quality
thumbnail_quailty=1

#audio only
#same as -m
is_audio_only=0

#download the video instead of watching/listening
#same as -d
is_download=0

#enable/disable selecting the first result automatically
#same as -a
auto_select=0
Expand All @@ -145,6 +157,10 @@ random_select=0
#same as -n{number}
link_count=1

#enable/disable searching again after the video ends
#same as -s
search_again=0

#enable/disable only showing the selected video's link
#same as -L
show_link_only=0
Expand Down Expand Up @@ -179,7 +195,12 @@ fancy_subscriptions_menu=1
#pt_search is the same as -P (searches peertube)
scrape="yt_search"

#auto generated caption from youtube
#same as --subt
auto_caption=0

#sort videos, history, and subscriptions by date from newest to oldest
#same as --sort
sort_videos_data=0

#the tab of trending to select when scrape is trending
Expand Down Expand Up @@ -265,6 +286,10 @@ handle_custom_shortcuts () {
# Other #
#############

#when no search is provided, or -s is given, use this prompt
search_prompt="Search : "


#useragent when using curl on youtube
useragent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.152 Safari/537.36"

Expand Down
13 changes: 8 additions & 5 deletions ytfzf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

YTFZF_VERSION="1.2.0_dev"


############################
# Defaults #
############################
Expand Down Expand Up @@ -66,6 +67,7 @@ thumb_disp_method=${YTFZF_THUMB_DISP_METHOD-${thumb_disp_method-ueberzug}}
#Stores the language for the auto genereated subtitles
selected_sub=${YTFZF_SELECTED_SUB-${selected_sub-}}


#> Clearing/Enabling fzf_defaults
#enable/disable the use of FZF_DEFAULT_OPTS
enable_fzf_default_opts=${YTFZF_ENABLE_FZF_DEFAULT_OPTS-${enable_fzf_default_opts-0}}
Expand All @@ -92,6 +94,7 @@ pid_file="$cache_dir/.pid"
shortcuts="${shortcuts-alt-l,alt-t,alt-o,alt-v,alt-d,alt-m,alt-s,alt-enter}"
search_prompt=${search_prompt-Search: }
#used when getting the html from youtube

useragent=${useragent-'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.152 Safari/537.36'}
#used when fancy_subscriptions_menu is 1
fancy_subscriptions_text=${fancy_subscriptions_text- -------%s-------}
Expand All @@ -105,7 +108,7 @@ exit_on_opt_error=${exit_on_opt_error-1}
is_ext_menu=${is_ext_menu-0}
#show thumbnails (same as -t)
show_thumbnails=${show_thumbnails-0}
# 0: better thumbnails (slower), 1: low res thumbnails (faster)
# 1: better thumbnails (slower), 0: low res thumbnails (faster)
thumbnail_quality=${thumbnail_quality-1}
#auto select the first video (same as -a)
auto_select=${auto_select-0}
Expand All @@ -123,19 +126,19 @@ silent_mode=${silent_mode-0}
show_format=${show_format-0}
#number of links to select with -a or -r (same as -n)
link_count=${link_count-1}
#number of videos to show in the subsciption menu
#number of videos to show in the subscription menu
sub_link_count=${sub_link_count-10}
#after video ends, make another search (same as -s)
search_again=${search_again-0}
#whether or not to show -----------channel------------ when looking at subscriptions
fancy_subscriptions_menu=${fancy_subscriptions_menu-1}
#sort subsciptions subsections based on time instead of channel
#sort subscriptions subsections based on time instead of channel
sort_videos_data=${sort_videos_data-0}
#filter id used when searching
sp=${sp-}
#is used to know whether or not scraping the search page is necessary
scrape=${scrape-yt_search}
#auto generated caption by youtube with enabled with --subt
#auto generated caption by YouTube with enabled with --subt
auto_caption=${auto_caption-0}
#only play/download the audio if set to 1
is_audio_only=${is_audio_only-0}
Expand Down Expand Up @@ -279,7 +282,7 @@ all_help_info () {
YTFZF_CONFIG_FILE='\$YTFZF_CONFIG_DIR/conf.sh' The configuration file
YTFZF_LOOP=0 1 : loop the selection prompt
YTFZF_PREF='' 22: 720p, 18: 360p (yt-dl formats)
YTFZF_CUR=1 For status bar bodules
YTFZF_CUR=1 For status bar modules
YTFZF_ENABLE_FZF_DEFAULT_OPTS=0 1 : fzf will use FZF_DEFAULT_OPTS
YTFZF_SELECTED_SUB=en Set default auto caption language (eg. English)
YTFZF_EXTMENU=' dmenu -i -l 30'
Expand Down

0 comments on commit 7cc9fdc

Please sign in to comment.