Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My artwork here! #187

Closed
peppelongo96 opened this issue Jul 21, 2020 · 7 comments · Fixed by #191
Closed

My artwork here! #187

peppelongo96 opened this issue Jul 21, 2020 · 7 comments · Fixed by #191

Comments

@peppelongo96
Copy link

Hi! I compiled a specific version of Destreamer useful for University of Calabria users. Looks up here and feel free to mention it and suggest features or get inspiration from :)

@lukaarma
Copy link
Collaborator

I see that it's based on polidown, if you want we have just released 2.1 that should let the user refresh the session so that it won't crash mid-download and I'm working on a complete implementatiom of aria2c with rpc-json over websoket for better reliability over spawning aria2c as a child process

Take a look at out refresh logic and copy as you like :) I'll try to remember to add your link to the reasons, ping me if I forget

@lukaarma
Copy link
Collaborator

Or if you want I can help you move the uniCal login logic over to Destreamer so that you have a more solid base to start and expand with new features

@lukaarma
Copy link
Collaborator

Let me know if you need anything!

@peppelongo96
Copy link
Author

peppelongo96 commented Jul 22, 2020

@lukaarma thanks man! I had a look of your work on Destreamer and what you are planning and that is absolutely fantastic! But rebasing UnicalDown on Destreamer properly developing model is a really hard work that not worth it. Unical has not too much aware users that could appreciate the work.
Howewer, in important notes, I wrote something about what I am really interested for (like a personal challange):

  • session cookies expiring, that doesn't permit consecutive downloads for more then 1 hour (sincerely, I didn't understand if you found a way properly for this with the newer version);
  • avoid PC auto suspend mode. I tried different ways and npm packages that heavily increased the package weight... and they clearly are not the right way to go.

Feel free to help me if you have some suggestion :)

@lukaarma
Copy link
Collaborator

avoid PC auto suspend mode.

This should be left to the user: they can change their power settings but there is no way to circumvent a system sleep from the nodejs sandbox

session cookies expiring

First order of business is that I suggest you should change from session cookies, that are extracted unreliably in polidown and switch to session eval in the page like we do
Second I solved (I hope) the refresh session problem by letting chrome create a 20MB~ cache folder and after the first login with "remember me" from the user every time we launch the browser with that cache the login is automatic
It's a quick hack to make this work but it's very reliable from what I can see
When I'll have more time (after aria2c) I'll play some more with the cookies and we'll see if I can come up with something more elegant
Here is the refresh session function

export async function refreshSession(url: string): Promise<Session> {

And here is the folder we pass to puppeteer
userDataDir: (argv.keepLoginCookies) ? chromeCacheFolder : undefined,

Check them out and maybe they can inspire you to create something similar

@peppelongo96
Copy link
Author

peppelongo96 commented Jul 22, 2020

@lukaarma okay, got it! I think is something that I can do in not much time. I can easily adapt your function and also move to session eval. Thanks for all suggestions :) and remind to pin my repo if you feel!

@peppelongo96
Copy link
Author

@lukaarma EDIT: I was looking for some way to implement your solution about session exipiring. It requires a total re-implementation of user token managment and so good hours to spend on it. I decided to edit my notes in the Readme project file by pinning your comment. Maybe someone could working on if already has what and how to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants