BL๐Ÿ…พG News


Actu G33k & admin stuff.

โ‹… 1 commentaire

Fix - ERROR: unable to download video data: HTTP Error 403: Forbidden

logo

When you want to download a youtube video and you have this:

 $ youtube-dl  https://youtu.be/JkeE2O15RFs
   [youtube] JkeE2O15RFs: Downloading webpage
   ERROR: unable to download video data: HTTP Error 403: Forbidden
 

You can try to fix with 2 steps:

First update youtube-dl with -U

 $ sudo youtube-dl -U

And finally try to remove the cache , yes the cache ... with --rm-cache-dir

 $ youtube-dl --rm-cache-dir
    Removing cache dir /root/.cache/youtube-dl ...

Try now :

 $ youtube-dl  https://youtu.be/JkeE2O15RFs  --no-cache-dir  -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" 
    [youtube] JkeE2O15RFs: Downloading webpage
    [youtube] JkeE2O15RFs: Downloading js player vflset
    [youtube] JkeE2O15RFs: Downloading js player vflset
    [download] Destination: Beastie Boys - Alive (Official Music Video)-JkeE2O15RFs.f137.mp4
    [download] 100% of 68.01MiB in 00:06
    [download] Destination: Beastie Boys - Alive (Official Music Video)-JkeE2O15RFs.f140.m4a
    [download] 100% of 3.71MiB in 00:00
    [ffmpeg] Merging formats into "Beastie Boys - Alive (Official Music Video)-JkeE2O15RFs.mp4"
    Deleting original file Beastie Boys - Alive (Official Music Video)-JkeE2O15RFs.f137.mp4 (pass -k to keep)
    Deleting original file Beastie Boys - Alive (Official Music Video)-JkeE2O15RFs.f140.m4a (pass -k to keep)

You can put --no-cache-dir to your command to avoid this, or delete the cache.

 $ youtube-dl  https://youtu.be/JkeE2O15RFs  --no-cache-dir  
 alias ytdl='youtube-dl  -o "%(title)s.%(ext)s" --extract-audio --audio-format mp3 -k --force-ipv4  --rm-cache-dir $1'
 alias ytdlV='youtube-dl  -o "%(title)s.%(ext)s" --force-ipv4 $1'

First line download and keep both video and mp3.
Second line download and keep only vdieo.
Bonus: --rm-cache-dir Delete cache from video file.

Enjoy! :)

by ๐Ÿ…ด๐Ÿ†๐Ÿ†๐Ÿ…ด๐Ÿ†„๐Ÿ†32
๐Ÿ…ด๐Ÿ…ฒ๐Ÿ…ท๐Ÿ”ต๐Ÿ†‚๐Ÿ†ˆ๐Ÿ†‚๐Ÿ†ƒ๐Ÿ…ด๐Ÿ…ผ



โ‹… 3 commentaires

alt

Corriger l'erreur HTTP Error 429: Too Many Requests avec youtube-dl

Si vous avez cette erreur avec youtube-dl

 ERROR: Unable to download webpage: HTTP Error 429: Too Many Requests (caused by HTTPError());
 please report this issue on https://yt-dl.org/bug .
 Make sure you are using the latest version; type  youtube-dl -U  to update. 
 Be sure to call youtube-dl with the --verbose flag and include its complete output.

Il suffit simplement de de rajouter l'option --force-ipv4 dans votre commande :

 $ youtube-dl  -o "%(title)s.%(ext)s" --force-ipv4 

Pour crรฉe un alias allez dans votre .bashrc et rajouter :

 alias ytdl='youtube-dl  -o "%(title)s.%(ext)s" --extract-audio --audio-format mp3 -k --force-ipv4  --rm-cache-dir $1'
 alias ytdlV='youtube-dl  -o "%(title)s.%(ext)s" --force-ipv4 $1'

La premiรจre ligne download et garde la vidรจo et le mp3.
La seconde ligne download et garde que la vidรฉo.
Bonus: --rm-cache-dir efface le cache pour la vidรฉo

 $ youtube-dl --rm-cache-dir

Plus qu'a taper dans votre terminal :

 $ ytdlV https://www.youtube.com/watch?v=7Uexuyy_HL8

rรฉsultat:

 $ ytdlV https://www.youtube.com/watch?v=7Uexuyy_HL8
 [youtube] 7Uexuyy_HL8: Downloading webpage
 [youtube] 7Uexuyy_HL8: Downloading video info webpage
 [youtube] 7Uexuyy_HL8: Extracting video information
 [download] Destination: Stupeflip - The Antidote.f248.webm
 [download] 100% of 1.50MiB in 00:00
 [download] Destination: Stupeflip - The Antidote.f251.webm
 [download] 100% of 3.24MiB in 00:00
 [ffmpeg] Merging formats into "Stupeflip - The Antidote.webm"
 Deleting original file Stupeflip - The Antidote.f248.webm (pass -k to keep)
 Deleting original file Stupeflip - The Antidote.f251.webm (pass -k to keep)

by ๐Ÿ…ด๐Ÿ†๐Ÿ†๐Ÿ…ด๐Ÿ†„๐Ÿ†32
๐Ÿ…ด๐Ÿ…ฒ๐Ÿ…ท๐Ÿ”ต๐Ÿ†‚๐Ÿ†ˆ๐Ÿ†‚๐Ÿ†ƒ๐Ÿ…ด๐Ÿ…ผ