Compare commits

...

11 Commits

Author SHA1 Message Date
TheHumanRobot c775828d13
Update README.md
2 years ago
TheHumanRobot e25315076e
Add files via upload
2 years ago
TheHumanRobot 208ff45f0e
Delete dist.zip
2 years ago
TheHumanRobot 2f47b56155
Update PrerollUpdate.py
2 years ago
TheHumanRobot a2253d153b
Update Preroll.py
2 years ago
TheHumanRobot 7624eedf54
Update README.md
2 years ago
TheHumanRobot b8e321d5c8
Update README.md
2 years ago
TheHumanRobot 21b692b925
Add files via upload
2 years ago
TheHumanRobot 2bb9a8b7b0
Delete dist.zip
2 years ago
TheHumanRobot 0de89d7cfb
Updated PrerollUpdate.py
2 years ago
TheHumanRobot a40c693486
Update Preroll.py
2 years ago

File diff suppressed because one or more lines are too long

@ -18,10 +18,9 @@ import pathlib
from configparser import *
def update():
with open('config.yml', 'r') as file:
doc = yaml.load(file, Loader=yaml.SafeLoader)
# Opening JSON file
f = open(str(doc["Plex"]["Path"]))
f = open(str('data.json'))
data = json.load(f)
@ -115,5 +114,98 @@ def update():
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
# Closing file
if data['Freq'][0] == 'Custom':
Date = datetime.date.today()
Date = Date.strftime("%Y-%m-%d")
if data['Start1'] <= Date <= data['End1']:
session = requests.Session()
session.verify = False
requests.packages.urllib3.disable_warnings()
plex = PlexServer(data['URL'], data['Token'], session, timeout=None)
prerolls = data['Path1']
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
elif data['Start2'] <= Date <= data['End2']:
session = requests.Session()
session.verify = False
requests.packages.urllib3.disable_warnings()
plex = PlexServer(data['URL'], data['Token'], session, timeout=None)
prerolls = data['Path2']
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
elif data['Start3'] <= Date <= data['End3']:
session = requests.Session()
session.verify = False
requests.packages.urllib3.disable_warnings()
plex = PlexServer(data['URL'], data['Token'], session, timeout=None)
prerolls = data['Path3']
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
elif data['Start4'] <= Date <= data['End4']:
session = requests.Session()
session.verify = False
requests.packages.urllib3.disable_warnings()
plex = PlexServer(data['URL'], data['Token'], session, timeout=None)
prerolls = data['Path4']
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
elif data['Start5'] <= Date <= data['End5']:
session = requests.Session()
session.verify = False
requests.packages.urllib3.disable_warnings()
plex = PlexServer(data['URL'], data['Token'], session, timeout=None)
prerolls = data['Path5']
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
elif data['Start6'] <= Date <= data['End6']:
session = requests.Session()
session.verify = False
requests.packages.urllib3.disable_warnings()
plex = PlexServer(data['URL'], data['Token'], session, timeout=None)
prerolls = data['Path6']
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
elif data['Start7'] <= Date <= data['End7']:
session = requests.Session()
session.verify = False
requests.packages.urllib3.disable_warnings()
plex = PlexServer(data['URL'], data['Token'], session, timeout=None)
prerolls = data['Path7']
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
elif data['Start8'] <= Date <= data['End8']:
session = requests.Session()
session.verify = False
requests.packages.urllib3.disable_warnings()
plex = PlexServer(data['URL'], data['Token'], session, timeout=None)
prerolls = data['Path8']
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
elif data['Start9'] <= Date <= data['End9']:
session = requests.Session()
session.verify = False
requests.packages.urllib3.disable_warnings()
plex = PlexServer(data['URL'], data['Token'], session, timeout=None)
prerolls = data['Path9']
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
elif data['Start10'] <= Date <= data['End10']:
session = requests.Session()
session.verify = False
requests.packages.urllib3.disable_warnings()
plex = PlexServer(data['URL'], data['Token'], session, timeout=None)
prerolls = data['Path10']
plex.settings.get('cinemaTrailersPrerollID').set(prerolls)
plex.settings.save()
print('Pre-roll updated')
# Closing file
f.close()

@ -15,7 +15,7 @@ For example you can have this setup to apply a standard Pre-roll during regular
## Installation
If you are on windows you can download the dist.zip file and run the excecutable. However you will still need to download the PrerollUpdate.py script if you want to have it update automatically in the background
If you are on windows you can download the dist.zip file and run the excecutable. ~~However you will still need to download the PrerollUpdate.py script if you want to have it update automatically in the background~~ This is now packaged in the dist.zip file
First make sure you have Python installed version 3.7 and above. Next run:
@ -66,8 +66,8 @@ How to get token: https://support.plex.tv/articles/204059436-finding-an-authenti
You can then setup a default pre-roll if you want or leave it blank
To set specific pre-roll fuctions select which type you want (Monthly, Weekly, Daily, Holiday), You will then see more fields on the right
#### *The path to the videos must be reachable by your Plex Server!*
To set specific pre-roll fuctions select which type you want (Monthly, Weekly, Daily, Holiday Custom), You will then see more fields on the right
### *The path to the videos must be reachable by your Plex Server!*
Monthly:
![image](https://user-images.githubusercontent.com/75536101/146992956-baa1dd72-57e0-4aa2-bbdf-8cf4e75cd4be.png)
@ -78,9 +78,12 @@ Weekly:
Daily:
![image](https://user-images.githubusercontent.com/75536101/146993063-d1dc0964-233c-4e11-8099-d5e9555b1497.png)
Holiday (If you want another holiday you can add that by using the weekly function and setting a date):
Holiday (If you want another holiday you can add that by using the weekly function and setting a date) :
![image](https://user-images.githubusercontent.com/75536101/146993137-a99e4e79-0e4f-4348-b72a-6ffa19a370cc.png)
Custom:
![image](https://user-images.githubusercontent.com/75536101/147268244-abf0f6d2-2fe5-43bd-93ec-d69e982d7425.png)
### Once you finish setting that up whatever you select in the Schedule section will be what the script will run on
For example in this photo

Binary file not shown.
Loading…
Cancel
Save