Your 2nd Add-On: Online Videos!
#83
@Roman_V_M

I am using your plugin.video.example for my own video plugin and I would appreciate it if you could help me out:

1- Do you think does it make sense to pickle the extracted video object to avoid re-downloading/re-extracting every time plugin runs, and just load the object instead.

2- If that make sense, since the extracted video URL would be outdated(most probably since some extracted from youtube) and fails to be played, the URL has to be updated and pickled again. My question is, where/how can I try the loaded pickle first and if it fails try to update/re-extract it and run it (in the except block)? Maybe inside router function?

python:

def router(paramstring):
    params = dict(parse_qsl(paramstring))
    if params:
        if params['action'] == 'listing':
            list_videos(params['category'])
       elif params['action'] == 'play':
           try:
               play_video(params['video'])
           except (ValueError, KeyError):
               logger.exception('Play video failed!!!')
              # RE-EXTRACT the URL VIDEO, OVERWRITE IT WITH EXISTING PICKLE FILE, RE-PLAY THE VIDEO
        else:
            raise ValueError('Invalid paramstring: {0}!'.format(paramstring))
    else:
       list_categories()​
​​

3- If not, what do you suggest for such a scenario?

Basically, my intention is to cache the extracted working URL in order to speed up the plugin, which is quite slow because of the video extraction. BTW, I already asked a question here

Cheers!
Reply


Messages In This Thread
Your 2nd Add-On: Online Videos! - by zag - 2015-11-20, 15:28
RE: Your 2nd Add-On: Online Videos! - by zag - 2015-11-20, 15:33
RE: Your 2nd Add-On: Online Videos! - by zag - 2015-11-30, 14:42
RE: Your 2nd Add-On: Online Videos! - by zag - 2015-12-01, 12:58
RE: Your 2nd Add-On: Online Videos! - by zag - 2016-01-18, 14:37
RE: Your 2nd Add-On: Online Videos! - by pa79 - 2020-09-09, 19:59
RE: Your 2nd Add-On: Online Videos! - by aam137 - 2020-10-04, 13:48
Logout Mark Read Team Forum Stats Members Help
Your 2nd Add-On: Online Videos!2