dark-nova / PSO2NA_UQ_Parser

PSO2NA UQ Parser
MIT License
0 stars 0 forks source link

Schedule starting on 2020-09-01 includes new "Time (GMT)" column which breaks parsing #2

Closed dark-nova closed 4 years ago

dark-nova commented 4 years ago

Reference

The addition of "Time (GMT)" probably corresponds to the fact that PSO2's Western release is now Global.

Stack trace

INFO - Initializing UQ MainPage...
INFO - Initializing UQ Schedule @ https://pso2.com/news/urgent-quests/urgentquestschedule0901
Traceback (most recent call last):
  File "main.py", line 9, in <module>
    mp.parse()
  File ".../PSO2NA_UQ_Parser/uq.py", line 491, in parse
    s.parse()
  File ".../PSO2NA_UQ_Parser/uq.py", line 363, in parse
    *(dates[ceil(widths/width) - 1] + time),
IndexError: list index out of range

I may end up ignoring the GMT column instead as a workaround.

dark-nova commented 4 years ago

To resolve this, the code now counts how many timezone columns exist in row 3 (below the first two rows dedicated for dates) and starts checking cells offset by that number, rather than assuming the 2nd cell (in rows after row 3) is safe.