Compare commits

...

3 Commits

Author SHA1 Message Date
Lucien Cartier-Tilet 1b5fb4144d
[Emacs] Better which-key description for shortcut 2021-01-07 19:14:45 +01:00
Lucien Cartier-Tilet 13943e5775
[Bootstrap] Add tldr to list of installed packages 2021-01-07 19:14:22 +01:00
Lucien Cartier-Tilet 26053b0e8b
[Bin] Fix issue downloading videos with ytdl
When downloading a whole channel, ytdl used to download everything
including playlists displayed on the user’s main page. Now, a check
is performed in order to verify if the URL passed is a channel, and
if it is only download the videos listed on their uploads page.
2021-01-06 16:10:39 +01:00
4 changed files with 9 additions and 5 deletions

View File

@ -87,7 +87,7 @@ qt5-imageformats qemu r raw-thumbnailer reflector ripgrep rofi rsync rtv \
ruby-rb-fsevent ruby-sass rustup samba scrot sent shadow siji-git \
simplescreenrecorder sshfs st-luke-git sxiv texlive-bin texlive-langchinese \
texlive-langcyrillic texlive-langgreek texlive-langjapanese texlive-langkorean \
texlive-latexextra texlive-localmanager-git texlive-most tmux tree \
texlive-latexextra texlive-localmanager-git texlive-most tldr tmux tree \
ttf-arphic-uming ttf-baekmuk ttf-charis-sil ttf-dejavu \
ttf-google-fonts-opinionated-git ttf-hanazono ttf-joypixels ttf-koruri \
ttf-liberation ttf-monapo ttf-sazanami ttf-tibetan-machine typescript \

View File

@ -833,7 +833,7 @@ The main aim of this function is to transform the URLs contained in the argument
:END:
The final function to declare before the main body of the script is ~_ytdl_download_batch~: it will look for each line, ignoring the ones beginning by ~#~, ~;~ and ~]~ (just like ~youtube-dl~) and will download them, assuming these are channel URLs or playlist URLs, however it should also work with direct video URLs.
What this function does is for each line, it will fetch the entierty of the video IDs found in a playlist or channel. Then, it will look each ID up the list of already downloaded videos and will add all new IDs to a queue of videos to be downloaded. It will then pass each new video ID to ~_ytdl_download_video~ directly.
What this function does is for each line, it will fetch the entierty of the video IDs found in a playlist or channel. Then, it will look each ID up the list of already downloaded videos and will add all new IDs to a queue of videos to be downloaded. It will then pass each new video ID to ~_ytdl_download_video~ directly. Beware that if you pass directly the URL of the channel, such as ~https://www.youtube.com/user/enyay~ if you want to download Tom Scotts videos, it will download everything on the main page of their channel, which means it will even download videos from playlists they decided to put on their channels front page, even if it is not theirs. So in that case, we need to append ~/videos~ to any channel URL.
#+BEGIN_SRC fish
function _ytdl_download_batch
set -q $FILE
@ -842,7 +842,11 @@ What this function does is for each line, it will fetch the entierty of the vide
set CHANNELS (cat $FILE | grep -vE "#|;|\]")
for c in $CHANNELS
_ytdl_log "INFO" "Getting IDs for channel $c"
set IDS (youtube-dl --get-id $c)
if test (egrep '\/c\/|user|channel' (echo $c |psub))
set -g IDS (youtube-dl --get-id "$c/videos")
else
set -g IDS (youtube-dl --get-id $c)
end
_ytdl_log "INFO" "Fetching new videos from channel"
for i in (seq (count $IDS))
printf "\rsearching (%d/%d)" $IDn (count $IDS)

View File

@ -3448,7 +3448,7 @@ Now, onto some shortcuts related to org-mode. Lets first declare the category
#+BEGIN_SRC emacs-lisp
(spacemacs/set-leader-keys-for-major-mode 'org-mode "ob" 'phundrak/blog-publish)
(spacemacs/declare-prefix-for-mode 'org-mode "ob" "blog")
(spacemacs/declare-prefix-for-mode 'org-mode "ob" "publish blog")
#+END_SRC
Now, I have a couple of shortcuts I use regularly:

View File

@ -221,7 +221,7 @@ Lets set in a custom varible what packages well be needing.
ruby-rb-fsevent ruby-sass rustup samba scrot sent shadow siji-git \
simplescreenrecorder sshfs st-luke-git sxiv texlive-bin texlive-langchinese \
texlive-langcyrillic texlive-langgreek texlive-langjapanese texlive-langkorean \
texlive-latexextra texlive-localmanager-git texlive-most tmux tree \
texlive-latexextra texlive-localmanager-git texlive-most tldr tmux tree \
ttf-arphic-uming ttf-baekmuk ttf-charis-sil ttf-dejavu \
ttf-google-fonts-opinionated-git ttf-hanazono ttf-joypixels ttf-koruri \
ttf-liberation ttf-monapo ttf-sazanami ttf-tibetan-machine typescript \