Merge branch 'main' of ssh://gitea.caret.be:2223/jens/vrtnu-app into main

This commit is contained in:
Jens Timmerman 2020-10-10 16:42:10 +02:00
commit 51194a75a5
2 changed files with 13 additions and 49 deletions

View File

@ -7,6 +7,19 @@ This app helps you browse the webpage https://www.vrt.be/vrtnu/ on your appletv,
This app is written entirely in SwiftUI, there are a bunch of limitations which are mainly because: SwiftUI lacks a lot of reatures at the moment, and this is my first ever Swift app.
# Installation
More detailed installation instructions might come later, basically you need to have a Mac, download XCode, import this project, on your Apple TV go to `Settings -> Remotes and devices -> Remote app and devices` and just leave it there.
On your XCode click `Window, Decices and Simulators` and now wait a little bit, if you are lucky (and on the same network) your apple tv will show up and want to pair with your Xcode. Enter the pairing number displayed on your tv.
close this window an din XCode click on where it says "Apple TV 4k (at 1080p)" and select your tvOS Device
click the play button.
The app will be compiled and uploaded to your Apple TV.
# Easy installation
I could create a TestFlight app and publish a link here so you can easily install it.
However Apple requires 99$ a year in fees to let anybody use this service. Since This is my First and only app on the apple platform I currenly do not have a developer account yet so I can not use this service.
Feel free to donate some bitcoin on `179GKJpJGWdSuk3ydjqDFTcYLkxog2AmQx`
# License
The code in this project is available without waranty under the GPL-v3 License

View File

@ -1,49 +0,0 @@
# curl https://www.vrt.be/vrtnu/a-z/ | grep -o /a-z/.*relevant | sort -u | cut -d '.' -f 1 > all_vrt
# 1 can be a lot of numbers, sometimes the first seasons are not available
import re
import os
import requests
import youtube_dl
startdir = os.getcwd()
ydl_opts = {
'username': '<vrt nu username here>',
'password': '<vrt nu password here>',
'no-overwrites': True,
}
ydl = youtube_dl.YoutubeDL(ydl_opts)
#all_vrt = open('all_vrt').readlines()
#all_vrt = set(re.findall('/a-z/(.*).relevant', requests.get('https://www.vrt.be/vrtnu/a-z/').text))
all_vrt = ['bevergem', 'de-collega-s', 'dox', 'duts', 'fc-de-kampioenen', 'het-peulengaleis', 'kamp-waes', 'kulderzipken', 'pano', 'postbus-x', 'reizen-waes', 'rick-stein-s-secret-france', 'stille-waters', 'team-scheire', 'the-handmaid-s-tale', 'tomtesterom', 'w817', 'wauters-vs--waes', 'witse', 'in-de-ban-van-tsjernobyl', 'factcheckers', 'flikken-maastricht', 'gentbrugge', 'geub', 'de-smurfen', 'deadwind', 'clinch','100-dagen', 'belpop-classics', 'de-blacklist', 'de-val--10-jaar-na-de-crisis','gevoel-voor-tumor' ]
for series in all_vrt:
for season in range(20):
# curl -v https://www.vrt.be/vrtnu/a-z/het-peulengaleis/3.lists.all-episodes/ | grep -o vrtnu[^\"]*
url = 'https://www.vrt.be/vrtnu/a-z/%s/%d.lists.all-episodes/' % (series.strip(), season)
#print(url)
all_eps = requests.get(url).text
episodes = set(re.findall('vrtnu/a-z/([^"]*)',all_eps))
print(episodes)
print([x.split('/')[-2] for x in episodes])
if episodes:
path = os.path.join(startdir,series,'Season_%d' % season)
try:
os.makedirs(path)
except:
pass
for episode in episodes:
print(episode)
path = os.path.join(startdir,series,'Season_%d' % season, episode.split('/')[-2])
print(path)
try:
os.mkdir(path)
os.chdir(path)
ydl.download(['https://www.vrt.be/vrtnu/a-z/' + episode])
except Exception as e:
print('skipping existing folder %s' % episode)
print(e)