Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Added putioDownloader #3814

Closed
wants to merge 3 commits into from
Closed

Added putioDownloader #3814

wants to merge 3 commits into from

Conversation

dumaresq
Copy link
Contributor

I have added one file couchpotato/core/downloaders

This file is a downloader for put.io. I have tested and it does work, though it could use some work. I read the docs on how to add stuff to couchpotato, but it seems to be related to people who want to fix bugs, in this case I'm not fixing a bug I'm adding a new feature...

Let me know if you need more information.

It does seem that this is a feature requested in #3079

files = client.File.list()
delete = self.conf('detele_file')
downloaddir = self.conf('download_dir')
tempdownloaddir = '/export/nas/Downloads/incomplete'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path is specific to your setup & will not work on someone else's system

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct. It seems I copied in the wrong version of the file. I will
upload the correct one tonight. Sorry about the confusion.
On Aug 19, 2014 6:45 AM, "Keith" notifications@github.com wrote:

In couchpotato/core/downloaders/putioDownload.py:

  •    try:
    
  •        client = putio.Client(OAUTH_TOKEN)
    
  •        if client.File.list():
    
  •            return True
    
  •    except:
    
  •        log.info('Failed to get file listing, check OAUTH_TOKEN')
    
  •        return False
    
  • def getFromPutio(self, **kwargs):
  •   log.info('Put.io Download has been called')
    
  •   OAUTH_TOKEN = self.conf('oauth_token')
    
  •   client = putio.Client(OAUTH_TOKEN)
    
  •   files = client.File.list()
    
  •   delete = self.conf('detele_file')
    
  •   downloaddir = self.conf('download_dir')
    
  •   tempdownloaddir = '/export/nas/Downloads/incomplete'
    

This path is specific to your setup & will not work on someone else's
system


Reply to this email directly or view it on GitHub
https://github.com/RuudBurger/CouchPotatoServer/pull/3814/files#r16407392
.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed that issue, and committed it, do I need to create a new pull request?

@RuudBurger
Copy link
Member

Awesome. will test this out this week!

@RuudBurger
Copy link
Member

Ok, checked it out. This isn't mergable yet. I've made a start on what is missing and added some comments.
Please check out https://github.com/RuudBurger/CouchPotatoServer/tree/putio/couchpotato/core/downloaders/putio

  • The oauth needs to be done via GUI. Please see notification > twitter on how it should work.
  • Status checking needs to be implemented for the renamer to work. Both status checking using the Put.io api and during downloading from put.io.
  • Make sure the getFromPutio method works async, so it won't block the rest of CP when downloading a file.
  • The callback url can be filled in by default with the current url from the brower (I'll make this when you have done the above ;)

If you need any help or questions, please let me know. Send me an email (info [at] couchpota.to) with your msn/gtalk/hangouts address, and we can talk.

@RuudBurger RuudBurger closed this Aug 29, 2014
@oimctony
Copy link

Hello guys !

Any news on this ?
I've seen some put.io references in the code, but it is not yet listed in the downloaders folder.

Thanks !

Anthony

@dumaresq
Copy link
Contributor Author

There is a putio sub folder now in the git master branch. Which as far as I
know works.
On Dec 28, 2014 6:48 AM, "oimctony" notifications@github.com wrote:

Hello guys !

Any news on this ?
I've seen some put.io references in the code, but it is not yet listed in
the downloaders folder.

Thanks !

Anthony


Reply to this email directly or view it on GitHub
#3814 (comment)
.

@oimctony
Copy link

Please don't kill a kitten Ruud, i installed the version from the master branch and now it indeed works.
( i preivously checked in the WIn version which is not updated yet.)

@oimctony
Copy link

oimctony commented Jan 3, 2015

Hello, i may have spoken too fast.
I can indeed snatch a movie with CP and see it on my put.io account, but CP doesnt download it on my PC. What i am missing here ?

@dumaresq
Copy link
Contributor Author

dumaresq commented Jan 4, 2015

There is a check box in the settings "download" this will download file,
but there are a few notes:

  1. You need to have couch listen on an external IP that putio can call
    (that's what the callback host is for).
  2. It's a little unreliable the socket that gets opened doesn't always get
    the whole file, so make sure your download is complete before deleting it
    from put.io.

I am trying to come up with better ways to handle this, but so far this is
the only way available. You are actually better off using firefox with
"downloadthemall" to download as this is reliable, and faster.

On Sat, Jan 3, 2015 at 6:00 PM, oimctony notifications@github.com wrote:

Hello, i may have spoken too fast.
I can indeed snatch a movie with CP and see it on my put.io account, but
CP doesnt download it on my PC. What i am missing here ?


Reply to this email directly or view it on GitHub
#3814 (comment)
.

@oimctony
Copy link

oimctony commented Jan 4, 2015

Ok ! Normally the external IP works just fine as i can connect to it from my phone in 3G.
The format of the callback host is an IP address like: 90.x.xxx.xx:1066 . No need for http: etc, right ?

Is there any way to get some logs for the download ?I can't seem to find anything in the global logs and I want to understand where the problem comes from, as i think the socket doesn't open correctly on my PC.

Actually, on Windows if you want more reliable "downloader" for put.io, there is this : http://sourceforge.net/projects/putiodwnldmngr/ .It is a downloader that automatically looks at folder on your put.io account, and download everything there is in it.

Maybe a way to do so would be to put the CP uploads in a folder dedicated to CP on put.io, and then this software would download it automatically from put.io on your PC. Then, the renamer within CP would finish the job.
( i tried it and it works like this, but i had to edit my default torrent download on put.io and assign it to a specific folder, stuff than CP could do.)

Thank you for your amazing work btw, i'm in love with CP since years, and i was disappointed not to be able to use it anymore when i moved to put.io :). Hope i can make it work !

@dumaresq
Copy link
Contributor Author

dumaresq commented Jan 4, 2015

You might have found a bug. I never tried it except on port 80. There are
logs, but the download is started on the putio side. So if it doesn't work
with a port number you would never get the log.

As for the downloader whatever I use needs to work on all oses. But if you
have that already setup. Just turn on couchpotatos renamed and point it to
the download location your downloader. This should just work.

I will check out the callback host with a port number.
On Jan 4, 2015 3:42 AM, "oimctony" notifications@github.com wrote:

Ok ! Normally the external IP works just fine as i can connect to it from
my phone in 3G.
The format of the callback host is an IP address like: 90.x.xxx.xx:1066 .
No need for http: etc, right ?

Is there any way to get some logs for the download ?I can't seem to find
anything in the global logs and I want to understand where the problem
comes from, as i think the socket doesn't open correctly on my PC.

Actually, on Windows if you want more reliable "downloader" for put.io,
there is this : http://sourceforge.net/projects/putiodwnldmngr/ .
It is a downloader that automatically looks at folder on your put.io
account, and download everything there is in it.

Maybe a way to do so would be to put the CP uploads in a folder dedicated
to CP on put.io, and then this software would download it automatically
from put.io.

Thank you for your amazing work btw, i'm in love with CP since years, and
i was disapointed not to be able to use it anymore when i moved to put.io
:). Hope i can make it work !


Reply to this email directly or view it on GitHub
#3814 (comment)
.

@oimctony
Copy link

oimctony commented Jan 4, 2015

Thanks for your answer ! :)

I'll leave it like this for now as it works quite well, the default download folder for put.io is still a small issue, but more than manageable.

Small question, do you know where in the code i could specify a dedicated folder to the Couchpotato uploads ? Could be easier this way.

Thanks !

@dumaresq
Copy link
Contributor Author

dumaresq commented Jan 4, 2015

Sorry I don't follow your question.
On Jan 4, 2015 7:56 AM, "oimctony" notifications@github.com wrote:

Thanks for your answer ! :)

I'll leave it like this for now as it works quite well, the default
download folder for put.io is still a small issue, but more than
manageable.

Small question, do you know where in the code i could specify a dedicated
folder to the Couchpotato uploads ? Could be easier this way.

Thanks !


Reply to this email directly or view it on GitHub
#3814 (comment)
.

@oimctony
Copy link

oimctony commented Jan 4, 2015

Sorry, wrongly asked.

Right now, CP puts the torrent file in the "home" folder on put.io. i want to be able to change that and specify a dedicated folder in put.io for CP uploads, so i was asking if i could specify a folder by myself directly :).

Thanks !

@dumaresq
Copy link
Contributor Author

dumaresq commented Jan 4, 2015

Ah ok. Right now it is line 44 in main.py in core/downloaders/putio I
believe you would pass in parent_id='directory' I haven't tried yet, and
I'm not 100% what all the params are to the putio API yet. If it works let
me know and I'll add it to the code...

On Sun, Jan 4, 2015 at 8:08 AM, oimctony notifications@github.com wrote:

Sorry, wrongly asked.

Right now, CP puts the torrent file in the "home" folder on put.io. i
want to be able to change that and specify a dedicated folder in put.io
for CP uploads, so i was asking if i could specify a folder by myself
directly :).

Thanks !


Reply to this email directly or view it on GitHub
#3814 (comment)
.

@dumaresq
Copy link
Contributor Author

dumaresq commented Jan 4, 2015

Ok I found a bug, in the callback url that does impact when you use a port
number. I'll patch this. I also noticed that the parent_id thing isn't
going to work because putio has changed there API. I'll update the API on
the couch side and add that as a feature.

I'll try to do the change today, but it might take until next weekend for
me to sort out the API changes that are needed.

On Sun, Jan 4, 2015 at 10:07 AM, Andrew Dumaresq dumaresq@gmail.com wrote:

Ah ok. Right now it is line 44 in main.py in core/downloaders/putio I
believe you would pass in parent_id='directory' I haven't tried yet, and
I'm not 100% what all the params are to the putio API yet. If it works let
me know and I'll add it to the code...

On Sun, Jan 4, 2015 at 8:08 AM, oimctony notifications@github.com wrote:

Sorry, wrongly asked.

Right now, CP puts the torrent file in the "home" folder on put.io. i
want to be able to change that and specify a dedicated folder in put.io
for CP uploads, so i was asking if i could specify a folder by myself
directly :).

Thanks !


Reply to this email directly or view it on GitHub
#3814 (comment)
.

@oimctony
Copy link

oimctony commented Jan 4, 2015

Thanks for the news !
I'll wait for the update then :)

Have a good day !

@dumaresq
Copy link
Contributor Author

dumaresq commented Jan 4, 2015

Ok I added a the folder feature and fixed the bug in the callback URL.
I've created a pull request (#4456) for RuudBurger, when it's merged you
should be good to go...

On Sun, Jan 4, 2015 at 12:01 PM, oimctony notifications@github.com wrote:

Thanks for the news !

I'll wait for the update then :)

Have a good day !


Reply to this email directly or view it on GitHub
#3814 (comment)
.

@oimctony
Copy link

oimctony commented Jan 5, 2015

You're a rockstar ;)

Enjoy your day !

@bslayton
Copy link

bslayton commented Mar 6, 2015

Does anyone know if there is a simple way to get this downloader to download the mp4 converted version from put.io, if the original video is not mp4? Or is this a feature that is missing from the downloader?

@dumaresq
Copy link
Contributor Author

dumaresq commented Mar 6, 2015

It wouldn't be able to do that, because the file name would be different.
If you want to do that you should tell couchpotato not to download it.
Then convert it and download it manually.

I'll think about how to manage this, but I'm not even aware of how I could
remotely kick off the conversion.

On Fri, Mar 6, 2015 at 12:10 PM, Ben Slayton notifications@github.com
wrote:

Does anyone know if there is a simple way to get this downloader to
download the mp4 converted version from put.io, if the original video is
not mp4? Or is this a feature that is missing from the downloader?


Reply to this email directly or view it on GitHub
#3814 (comment)
.

@leolobato
Copy link

There is an API to trigger the MP4 conversion, maybe that could work?

https://put.io/v2/docs/files.html#convert-to-mp4

@dumaresq
Copy link
Contributor Author

dumaresq commented Mar 6, 2015

Ok that would help convert, but it doesn't return the name or ID of the
file once it is done, so I don't know how useful that would be.

On Fri, Mar 6, 2015 at 3:32 PM, Leo Lobato notifications@github.com wrote:

There is an API to trigger the MP4 conversion, maybe that could work?

https://put.io/v2/docs/files.html#convert-to-mp4


Reply to this email directly or view it on GitHub
#3814 (comment)
.

@bslayton
Copy link

bslayton commented Mar 7, 2015

I'm not sure why it isn't clearly documented in the API, but in order to download the converted video it is nearly the exact same as downloading the original file.

Instead of
/files/<id>/download
you would do
/files/<id>/mp4/download

Adding to what @leolobato said, In addition to using the api to request a conversion, you can also check the conversion status.

When I get a chance, I will take a look at your code. I don't know python very well. Last thing I want to do is go in a screw it up. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants