In [ ]:
%load_ext autoreload
%autoreload 2
In [12]:
import nrkdownload
series = nrkdownload.nrktv.series_from_series_id('dagsnytt')
program = series.seasons[-1].episodes[-2]
program.get_download_details()
program.make_filename()
nrkdownload.nrktv.download_programs([program])
In [11]:
dir(program)
Out[11]:
In [ ]:
import nrkdownload
import logging
nrkdownload.nrktv.LOG.setLevel(logging.INFO)
In [ ]:
In [ ]:
s = nrkdownload.nrktv.series_from_series_id('dagsnytt')
In [ ]:
p = s.seasons[-1].episodes[-2]
p.get_download_details()
In [ ]:
nrkdownload.nrktv.download_programs_in_parallel([p])
In [ ]:
In [ ]:
string = 'vestlandsrevyen'
search_type = 'series'
result = nrkdownload.nrktv.search(string, search_type)
result
In [ ]:
nrkdownload.nrktv.LOG.setLevel(logging.WARNING)
for r in result:
print(r)
r.get_seasons_and_episodes()
for s in r.seasons:
print(' '*4, s, s.number)
# for e in s.episodes:
# print(' '*8, e)
In [ ]:
string = 'skam'
search_type = 'program'
result = nrkdownload.nrktv.search(string, search_type)
result
In [ ]:
r = nrkdownload.nrktv.search('Herdlefjorden', 'program')
r
In [ ]:
r[0].get_download_details()
In [ ]:
r[0].media_urls
In [ ]:
r[0].make_filename()
In [ ]:
s = nrkdownload.nrktv.series_from_series_id('tidenes-sommer')
In [ ]:
s.get_seasons_and_episodes()
In [ ]:
for se in s.seasons:
print(se)
for e in se.episodes:
print(e)
In [ ]:
p = s.seasons[-1].episodes[-2]
print(p)
In [ ]:
p.program_id
In [ ]:
p.program_id
In [ ]:
import requests
NRK_PS_API = 'http://v8.psapi.nrk.no'
SESSION = requests.Session()
SESSION.headers['app-version-android'] = '999'
program_id = 'MUHH48000516'
r = SESSION.get(NRK_PS_API + '/mediaelement/' + program_id)
r.raise_for_status()
json = r.json()
json['programId'] = program_id
json['imageId'] = json['image']['id']
program = nrkdownload.nrktv.new_program_from_search_result(json)
program.get_download_details(json=json)
In [ ]:
program.series_id
In [ ]:
s = nrkdownload.nrktv.series_from_series_id('paa-date')
dir(s)
In [ ]:
nrkdownload.config.KNOWN_SERIES
In [ ]:
s = nrkdownload.nrktv.series_from_series_id('sjakk')
In [ ]:
d = {1: 'sdaf', 2: 'fdg'}
In [ ]:
if 1 in d:
print("Yes")
In [ ]:
p.get_download_details()
p.media_urls
In [ ]:
[s for s in dir(p) if not s.startswith('__')]
In [ ]:
p.get_download_details()
In [ ]:
p.subtitle_urls
In [ ]:
result[0].episode_number_or_date
In [ ]:
result[0].seasons[0].episodes[1].programId
In [ ]:
nrkdownload.config.KNOWN_SERIES['skam'].get_seasons_and_episodes()
In [ ]: