forked from Hellowlol/nrk_api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamples.py
More file actions
47 lines (32 loc) · 1.07 KB
/
examples.py
File metadata and controls
47 lines (32 loc) · 1.07 KB
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from nrkdl import NRK
def example_search():
nrk = NRK
search_results = nrk.search('Brannman Sam')
for search in search_results:
for season in search.seasons():
for episode in season.episodes():
episode.download()
episode.subtitle()
print('We found %s episodes to download' % len(nrk.downloads()))
# example_search()
def example_site_rip():
""" Please, dont do this.. """
nrk = NRK
all_programs = nrk.site_rip()
for media in all_programs:
if media.type == 'serie':
for serie in media.episodes():
#serie.download()
pass
else:
#media.download()
pass
#nrk.downloads().start()
example_site_rip()
def example_parse_url():
# This starts downloading right away
NRK.parse_urls('https://tv.nrk.no/serie/skam/MYNT15001016/sesong-2/episode-10 http://tv.nrksuper.no/serie/lili/MSUI28008314/sesong-1/episode-3')
# example_parse_url()