This repository has been archived by the owner on Nov 12, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tv
executable file
·62 lines (55 loc) · 3.03 KB
/
tv
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
#!/usr/bin/python
# @todo : see https://github.com/dlh/youtube-dl-parallel/blob/master/youtube-dl-parallel
import os
from datetime import date
from dateutil.relativedelta import *
# url list to download
urls = [
'http://www.youtube.com/user/PomfEtThud/videos', #pomf et thud
'http://www.youtube.com/user/NormanFaitDesVideos/videos', #norman
'http://www.youtube.com/user/joueurdugrenier/videos', #joueur du grenier
'http://www.youtube.com/user/MrAntoineDaniel/videos', #mr antoine daniel
'http://www.youtube.com/user/smoshfrance/videos', #smosh france
'http://www.youtube.com/user/LivelyLadder/videos', #lively ladder
'https://www.youtube.com/user/GamersOriginTV/videos', #gamers origin tv
'http://www.youtube.com/user/LeZAPdeSpi0nOfficiel/videos', #le zap de spion
# 'http://www.youtube.com/user/jvcom/videos', #jvc
# 'http://www.youtube.com/user/jvcomchroniques/videos', #jcv chroniques
'http://www.canalplus.fr/c-divertissement/c-le-petit-journal/pid6515-l-emission.html', #le petit journal
# 'http://www.canalplus.fr/c-divertissement/c-le-grand-journal/pid5411-le-grand-journal-l-emission.html', #le grand journal
'http://www.canalplus.fr/c-divertissement/pid1784-c-les-guignols.html', #les gigniols
'http://www.canalplus.fr/c-divertissement/pid1787-c-groland.html', #groland
'http://www.canalplus.fr/c-infos-documentaires/pid3356-c-effet-papillon.html', #l'effet papillon
'http://www.canalplus.fr/c-infos-documentaires/pid4583-c-ms-l-oeil-de-links.html', #l'oeil de links
'http://www.canalplus.fr/c-infos-documentaires/pid1830-c-zapping.html', #le zapping
]
# script paths
_dir = os.path.dirname(os.path.abspath(__file__))
youtubeDL = _dir + '/youtube-dl'
folder = _dir + '/dl'
# clean dl folder : delete older videos for space
for file in os.listdir(folder):
path = os.path.join(folder, file)
try:
if os.path.isfile(path):
uploadDate = date(int(file[0:4]),int(file[4:6]),int(file[6:8]))
sinceDate = date.today() + relativedelta(weeks=-1, days=-1)
if uploadDate < sinceDate:
os.unlink(path)
except Exception, e:
print e
# download videos
cmds = []
for url in urls:
cmd = ' '.join([
youtubeDL,
#'--get-url',
#'--get-title',
'--dateafter now-1week',
'-o "' + folder + '/%(upload_date)s.%(title)s.%(ext)s"',
'--restrict-filenames',
'--playlist-end 20',
url
])
cmds.append(cmd)
os.system(';'.join(cmds)+';');