-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path11_22_2019-YoutubeDL.ps1
62 lines (48 loc) · 1.98 KB
/
11_22_2019-YoutubeDL.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#Open file
(Get-Content C:\FicheroURLwebs.txt) | %{
$_
#Use youtube-dl
#Youtube-dl is a small command-line program to download videos from YouTube.com and a few more sites. It requires the Python interpreter (2.6, 2.7, or 3.3+), and it is not platform specific. We also provide a Windows executable that includes Python. youtube-dl should work in your Unix box, in Windows or in Mac OS X. It is released to the public domain, which means you can modify it, redistribute it or use it however you like.
C:\exa\youtube-dl.exe $_
}
Invoke-WebRequest "http://10.202.0.14:8000/SoundHelix-Song-1.mp3"
$ErrorActionPreference = "SilentlyContinue"
##################################
###########################
##################################
###########################
##################################
$ErrorActionPreference = "SilentlyContinue"
Invoke-WebRequest "http://www.goosgle.es" -ErrorVariable ErrorWeb
If ($ErrorWeb) {
####### Something went wrong
"No existe la web"
}
# SilentlyContinue: se suprimen los mensajes de error y la ejecución continúa
# Stop: se detiene la ejecución
# Continue: es la opción por defecto. Se muestra el error y la ejecución continúa
# Inquire: pregunta al usuario como proceder
# Ignore: el error es ignorado y no se registra ni muestra.
####################################
####################################
####################################
# Fichero URLS
## https://www.youtube.com/watch?v=6DeDzsCGbsQ
## https://www.youtube.com/watch?v=6DeDzsCGbsQ
## https://www.youtube.com/watch?v=6DeDzsCGbsQadsfdsfdasfdas
## https://www.youtu444be.com/watch?v=6DeDzsCGbsQ
## https://www.youtube.com/watch?v=6DeDzsCGbsQ
$ErrorActionPreference = "SilentlyContinue"
foreach($urls in gc urls.txt)
{
$web = Invoke-WebRequest $urls -ErrorVariable ErrorWeb
if ($ErrorWeb)
{
####### Something went wrong
"No existe la web"
}
else
{
"Sí existe la web"
}
}