Closed EchterAlsFake closed 1 year ago
Hey
Yeah v4 is absolutely not ready, there is so much work to be done, and i can't put time in a project of that scale right now.
About the issue, this is caused by a PH update. They have removed their old obfuscated M3U master url. PHUB already work around it, using mediaDefinitions urls. The real problem is, I have no idea why the parser was still trying to parse it, if it was/still is nescessary or not.
I'm in no state to commit something as of now, i'll fix that later this weekend. In the meantime, here is a monkeypatch to apply after importing phub.
import phub
def patch(video: phub.Video) -> dict:
'''
Monkey patch for phub.parser.resolve.
'''
phub.utils.log('parser', 'Resolving page JS script...', level = 6)
for _ in range(phub.parser.RENEW_MAX_ATTEMPTS):
response = phub.consts.regexes.video_flashvar(video.page)
if not len(response):
phub.parser.renew(video)
continue
flash, ctx = response[0]
break
else:
raise phub.errors.ParsingError('Max renew attempts exceeded.')
# Load context
return phub.parser.json.loads(ctx)
phub.parser.resolve = patch
# Then do whatever you want as normal
client = phub.Client()
video = client.get(key = '...')
video.download('test.mp4', 'best')
Tell me if it fixes the error. Have a great day (or night)
Issue is fixed with the patch.
Thanks for the quick reply :)
Fixed and released with 3.2.2. Thanks!
Hey,
I got the following error:
I tried with my UI and with your CLI script.
I used the V3.2.1 API version, but I haven't tried it with V4 as you said it would be unstable and not production ready.