Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11,903 changes: 11,409 additions & 494 deletions Series.txt

Large diffs are not rendered by default.

269 changes: 145 additions & 124 deletions Tracks.txt

Large diffs are not rendered by default.

92 changes: 92 additions & 0 deletions genTxt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#! /usr/bin/env python

import json
import requests
import hashlib
import base64
import os
import getpass
from PIL import Image, UnidentifiedImageError

IRURLBASE = 'https://members-ng.iracing.com'
REPODIR = os.path.dirname(__file__)

def getTracks(cookies, paths):
trackpath = paths['track']['get']['link']
s3path = requests.get(trackpath, cookies=cookies).json()['link']
return requests.get(s3path).json()

def formatTracks(trackJson):
trackList = list()
for track in trackJson:
if track.get('config_name', False):
trackList.append(f"{track['track_id']} {track['track_name']} - {track['config_name']}")
else:
trackList.append(f"{track['track_id']} {track['track_name']}")
with open(f'{REPODIR}/tracks.txt', 'w') as tf:
tf.write('\n'.join(trackList))
return trackList

def getSeries(cookies, paths):
seriespath = paths['series']['stats_series']['link']
s3path = requests.get(seriespath, cookies=cookies).json()['link']
return requests.get(s3path).json()

def getLicense(allowedLicense):
licenses = ['R', 'D', 'C', 'B', 'A', 'Pro', 'Pro/WC']
if len(allowedLicense) > 1:
return licenses[allowedLicense[1]['license_group']]
else:
return licenses[allowedLicense[0]['license_group']]

def formatSeries(seriesJson):
seriesList = list()
licenses = ['R', 'D', 'C', 'B', 'A', 'Pro', 'Pro/WC']
for series in seriesJson:
if not series['series_name'].startswith('13th Week'):
for season in series['seasons']:
seriesList.append('\n'.join(
[f"{season['season_id']} {series['series_name']} : {series['category']}",
f"\tLICENSE {licenses[(season['license_group']) - 1]}",
f"\tID {season['series_id']}"]
))
if series['logo']:
seriesLogo = f"https://images-static.iracing.com/img/logos/series/{series['logo']}"
logoData = requests.get(seriesLogo)
with open(f"{REPODIR}/html/images/{series['series_id']}.png", 'wb') as logo:
logo.write(logoData.content)
try:
with Image.open(f"{REPODIR}/html/images/{series['series_id']}.png") as logo:
icon = logo.resize((57, 22))
icon.save(f"{REPODIR}/html/images/icon/{series['series_id']}.png")
except UnidentifiedImageError:
print(f"==> Series {series['series_name']} (id {series['series_id']}) doesn't havea valid image.")
with open(f"{REPODIR}/series.txt", 'w') as st:
st.write('\n'.join(seriesList))
return seriesList


def irLogin(user, pw):
encodedpw = base64.b64encode(
hashlib.sha256(bytes(pw, 'utf-8') + bytes(user.lower(), 'utf-8')).digest()
)
logindata = {
'email': user,
'password': encodedpw.decode('utf-8')
}
auth = requests.post(f'https://members-ng.iracing.com/auth', data=logindata)
cookies = auth.cookies
r = requests.get(f'{IRURLBASE}/data/doc', cookies=cookies)
return cookies, json.loads(r.text)

def main():
email = input("iRacing email: ")
password = getpass.getpass("iRacing password: ")
cookies, paths = irLogin(email, password)
allTracks = getTracks(cookies, paths)
formatTracks(allTracks)
allSeries = getSeries(cookies, paths)
formatSeries(allSeries)

if __name__ == '__main__':
main()
Binary file added html/images/102.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed html/images/103.jpg
Binary file not shown.
Binary file added html/images/103.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed html/images/112.jpg
Binary file not shown.
Binary file added html/images/112.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/images/115.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed html/images/116.jpg
Binary file not shown.
Binary file added html/images/116.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/images/130.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed html/images/131.jpg
Binary file not shown.
Binary file added html/images/131.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/images/132.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed html/images/133.jpg
Binary file not shown.
Binary file added html/images/133.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/images/134.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/images/135.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed html/images/139.jpg
Binary file not shown.
Binary file added html/images/139.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed html/images/164.jpg
Binary file not shown.
Binary file added html/images/164.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed html/images/165.jpg
Binary file not shown.
Binary file added html/images/165.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added html/images/166.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed html/images/167.jpg
Binary file not shown.
Binary file added html/images/167.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed html/images/182.jpg
Diff not rendered.
Binary file added html/images/182.png
Binary file added html/images/183.png
Binary file removed html/images/190.jpg
Diff not rendered.
Binary file added html/images/190.png
Binary file removed html/images/191.jpg
Diff not rendered.
Binary file added html/images/191.png
Binary file added html/images/197.png
Binary file added html/images/201.png
Binary file added html/images/205.png
Binary file added html/images/206.png
Binary file removed html/images/207.jpg
Diff not rendered.
Binary file added html/images/207.png
Binary file removed html/images/210.jpg
Diff not rendered.
Binary file added html/images/210.png
Binary file added html/images/223.png
Binary file added html/images/227.png
Binary file removed html/images/228.jpg
Diff not rendered.
Binary file added html/images/228.png
Binary file removed html/images/229.jpg
Diff not rendered.
Binary file added html/images/229.png
Binary file removed html/images/231.jpg
Diff not rendered.
Binary file added html/images/231.png
Binary file added html/images/233.png
Binary file removed html/images/237.jpg
Diff not rendered.
Binary file added html/images/237.png
Binary file added html/images/242.png
Binary file added html/images/245.png
Binary file added html/images/247.png
Binary file added html/images/248.png
Binary file added html/images/256.png
Binary file added html/images/258.png
Binary file removed html/images/259.jpg
Diff not rendered.
Binary file added html/images/259.png
Binary file removed html/images/260.jpg
Diff not rendered.
Binary file added html/images/260.png
Binary file added html/images/262.png
Binary file added html/images/266.png
Binary file added html/images/267.png
Binary file added html/images/268.png
Binary file removed html/images/269.jpg
Diff not rendered.
Binary file added html/images/269.png
Binary file added html/images/271.png
Binary file removed html/images/275.jpg
Diff not rendered.
Binary file added html/images/275.png
Binary file removed html/images/277.jpg
Diff not rendered.
Binary file added html/images/277.png
Binary file added html/images/278.png
Binary file added html/images/279.png
Binary file added html/images/280.png
Binary file added html/images/281.png
Binary file removed html/images/285.jpg
Diff not rendered.
Binary file added html/images/285.png
Binary file removed html/images/286.jpg
Diff not rendered.
Binary file added html/images/286.png
Binary file added html/images/288.png
Binary file added html/images/290.png
Binary file removed html/images/291.jpg
Diff not rendered.
Binary file added html/images/291.png
Binary file removed html/images/292.jpg
Diff not rendered.
Binary file added html/images/292.png
Binary file added html/images/295.png
Binary file added html/images/297.png
Binary file added html/images/298.png
Binary file removed html/images/299.jpg
Diff not rendered.
Binary file added html/images/299.png
Binary file removed html/images/303.jpg
Diff not rendered.
Binary file added html/images/303.png
Binary file added html/images/304.png
Binary file removed html/images/305.jpg
Diff not rendered.
Binary file added html/images/305.png
Binary file removed html/images/306.jpg
Diff not rendered.
Binary file added html/images/306.png
Binary file removed html/images/307.jpg
Diff not rendered.
Binary file added html/images/307.png
Binary file removed html/images/308.jpg
Diff not rendered.
Binary file added html/images/308.png
Binary file removed html/images/309.jpg
Diff not rendered.
Binary file added html/images/309.png
Binary file removed html/images/310.jpg
Diff not rendered.
Binary file added html/images/310.png
Binary file removed html/images/311.jpg
Diff not rendered.
Binary file added html/images/311.png
Binary file added html/images/312.png
Binary file added html/images/314.png
Binary file removed html/images/315.jpg
Diff not rendered.
Binary file added html/images/315.png
Binary file added html/images/316.png
Binary file added html/images/317.png
Binary file added html/images/318.png
Binary file added html/images/319.png
Binary file removed html/images/32.jpg
Diff not rendered.
Binary file added html/images/32.png
Binary file added html/images/320.png
Binary file added html/images/321.png
Binary file added html/images/322.png
Binary file added html/images/323.png
Binary file added html/images/324.png
Binary file removed html/images/325.jpg
Diff not rendered.
Binary file added html/images/325.png
Binary file added html/images/326.png
Binary file removed html/images/327.jpg
Diff not rendered.
Binary file added html/images/327.png
Binary file added html/images/328.png
Binary file added html/images/329.png
Binary file added html/images/33.png
Binary file added html/images/330.png
Binary file removed html/images/331.jpg
Diff not rendered.
Binary file added html/images/331.png
Binary file added html/images/332.png
Binary file added html/images/333.png
Binary file added html/images/334.png
Binary file removed html/images/335.jpg
Diff not rendered.
Binary file added html/images/335.png
Binary file added html/images/336.png
Binary file added html/images/337.png
Binary file added html/images/338.png
Binary file added html/images/339.png
Binary file removed html/images/34.jpg
Diff not rendered.
Binary file added html/images/34.png
Binary file added html/images/341.png
Binary file added html/images/342.png
Binary file added html/images/343.png
Binary file added html/images/344.png
Binary file added html/images/345.png
Binary file added html/images/346.png
Binary file added html/images/347.png
Binary file added html/images/348.png
Binary file added html/images/351.png
Binary file added html/images/352.png
Binary file removed html/images/353.jpg
Diff not rendered.
Binary file added html/images/353.png
Binary file added html/images/354.png
Binary file added html/images/355.png
Binary file added html/images/356.png
Binary file added html/images/357.png
Binary file added html/images/358.png
Binary file removed html/images/359.jpg
Diff not rendered.
Binary file added html/images/359.png
Binary file added html/images/360.png
Binary file added html/images/361.png
Binary file added html/images/362.png
Binary file added html/images/363.png
Binary file added html/images/364.png
Binary file added html/images/365.png
Binary file removed html/images/369.jpg
Diff not rendered.
Binary file added html/images/369.png
Binary file added html/images/370.png
Binary file added html/images/371.png
Binary file added html/images/372.png
Binary file added html/images/373.png
Binary file removed html/images/374.jpg
Diff not rendered.
Binary file added html/images/374.png
Binary file added html/images/377.png
Binary file added html/images/378.png
Binary file added html/images/379.png
Binary file added html/images/380.png
Binary file added html/images/382.png
Binary file added html/images/383.png
Binary file added html/images/384.png
Binary file removed html/images/386.jpg
Diff not rendered.
Binary file added html/images/386.png
Binary file added html/images/387.png
Binary file added html/images/388.png
Binary file added html/images/389.png
Binary file added html/images/390.png
Binary file removed html/images/391.jpg
Diff not rendered.
Binary file added html/images/391.png
Binary file added html/images/392.png
Binary file added html/images/395.png
Binary file added html/images/396.png
Binary file removed html/images/397.jpg
Diff not rendered.
Binary file added html/images/397.png
Binary file added html/images/398.png
Binary file removed html/images/399.jpg
Diff not rendered.
Binary file added html/images/399.png
Binary file added html/images/400.png
Binary file added html/images/401.png
Binary file added html/images/402.png
Binary file added html/images/403.png
Binary file added html/images/404.png
Binary file removed html/images/405.jpg
Diff not rendered.
Binary file added html/images/405.png
Binary file added html/images/406.png
Binary file added html/images/407.png
Binary file added html/images/408.png
Binary file added html/images/409.png
Binary file added html/images/410.png
Binary file added html/images/411.png
Binary file added html/images/412.png
Binary file removed html/images/413.jpg
Diff not rendered.
Binary file added html/images/413.png
Binary file removed html/images/414.jpg
Diff not rendered.
Binary file added html/images/414.png
Binary file added html/images/415.png
Binary file removed html/images/416.jpg
Diff not rendered.
Binary file added html/images/416.png
Binary file removed html/images/417.jpg
Diff not rendered.
Binary file added html/images/417.png
Binary file added html/images/418.png
Binary file removed html/images/419.jpg
Diff not rendered.
Binary file added html/images/419.png
Binary file added html/images/420.png
Binary file added html/images/421.png
Binary file removed html/images/422.jpg
Diff not rendered.
Binary file added html/images/422.png
Binary file removed html/images/423.jpg
Diff not rendered.
Binary file added html/images/423.png
Binary file added html/images/424.png
Binary file added html/images/426.png
Binary file added html/images/427.png
Binary file removed html/images/428.jpg
Diff not rendered.
Binary file added html/images/428.png
Binary file removed html/images/429.jpg
Diff not rendered.
Binary file added html/images/429.png
Binary file removed html/images/430.jpg
Diff not rendered.
Binary file added html/images/430.png
Binary file removed html/images/431.jpg
Diff not rendered.
Binary file added html/images/431.png
Binary file removed html/images/432.jpg
Diff not rendered.
Binary file added html/images/432.png
Binary file removed html/images/433.jpg
Diff not rendered.
Binary file added html/images/433.png
Binary file added html/images/434.png
Binary file added html/images/435.png
Binary file added html/images/436.png
Binary file removed html/images/437.jpg
Diff not rendered.
Binary file added html/images/437.png
Binary file added html/images/438.png
Binary file removed html/images/439.jpg
Diff not rendered.
Binary file added html/images/439.png
Binary file added html/images/44.png
Binary file removed html/images/440.jpg
Diff not rendered.
Binary file added html/images/440.png
Binary file removed html/images/441.jpg
Diff not rendered.
Binary file added html/images/441.png
Binary file removed html/images/442.jpg
Diff not rendered.
Binary file added html/images/442.png
Binary file removed html/images/443.jpg
Diff not rendered.
Binary file added html/images/443.png
Binary file removed html/images/444.jpg
Diff not rendered.
Binary file added html/images/444.png
Binary file added html/images/445.png
Binary file removed html/images/446.jpg
Diff not rendered.
Binary file added html/images/446.png
Binary file removed html/images/447.jpg
Diff not rendered.
Binary file added html/images/447.png
Binary file removed html/images/448.jpg
Diff not rendered.
Binary file added html/images/448.png
Binary file added html/images/449.png
Binary file removed html/images/45.jpg
Diff not rendered.
Binary file added html/images/45.png
Binary file added html/images/450.png
Binary file removed html/images/451.jpg
Diff not rendered.
Binary file added html/images/451.png
Binary file added html/images/452.png
Binary file removed html/images/453.jpg
Diff not rendered.
Binary file added html/images/453.png
Binary file added html/images/454.png
Binary file removed html/images/455.jpg
Diff not rendered.
Binary file added html/images/455.png
Binary file removed html/images/456.jpg
Diff not rendered.
Binary file added html/images/456.png
Binary file removed html/images/457.jpg
Diff not rendered.
Binary file added html/images/457.png
Binary file removed html/images/458.jpg
Diff not rendered.
Binary file added html/images/458.png
Binary file removed html/images/459.jpg
Diff not rendered.
Binary file added html/images/459.png
Binary file removed html/images/460.jpg
Diff not rendered.
Binary file added html/images/460.png
Binary file removed html/images/461.jpg
Diff not rendered.
Loading