[Release] Simple downloader
#16
Full Debug log for ZeroDivisionError http://pastebin.com/KygxEyBy

I was able to fix this ZeroDivisionError.

The problem happens in:
script.module.simple.downloader\lib\SimpleDownloader.py", line 485, in _updateProgress
Code:
speed = int((get("bytes_so_far") / 1024) / (new_mark - get("mark")))

When a download starts, new_mark will sometimes equal get("mark"). This causes the denominator in the equation to be zero and python errors out. I'm not sure if this is the best fix, but replacing line 485 with the code below prevents a zero denominator.

Code:
if new_mark == get("mark"):
            speed = 0
        else:
            speed = int((get("bytes_so_far") / 1024) / (new_mark - get("mark")))

I've test this and it works fine.
Reply
#17
Ah yes, that makes perfect sense.

thanks Smile
Reply
#18
I've been having the same issue for the past several days. Is there a binary patch available or do I need to manually fix this and recompile?

thanks.
Reply
#19
No recompile needed. I need to push a new update.

This was a stupid bug that i never hit myself :/
Reply
#20
TobiasTheCommie Wrote:No recompile needed. I need to push a new update.

any updates on this?

Im thinking about using your module in my addons - but at the moment it is unusable Wink

regards,
sphere
My GitHub. My Add-ons:
Image
Reply
#21
sphere Wrote:any updates on this?

Im thinking about using your module in my addons - but at the moment it is unusable Wink

regards,
sphere

It will come when it comes. Sorry, i don't feel confident in giving a specific date.

I do expect to push an update before the next YouTube update. Hopefully there will be no interface changes from now on in, So pushing should no longer be locked. I hope.
Reply
#22
TobiasTheCommie Wrote:It will come when it comes. Sorry, i don't feel confident in giving a specific date.

I do expect to push an update before the next YouTube update. Hopefully there will be no interface changes from now on in, So pushing should no longer be locked. I hope.

Hi

Ok cool. Sure Push it when you feel that it is done Smile
I just wanted to know if there are any Updates Wink

Regards
sphere
My GitHub. My Add-ons:
Image
Reply
#23
How would I setup the params to acheive the equivalent of this:

Code:
C:\RTMP\rtmpdump.exe
--rtmp "rtmpe://cp72511.edgefcs.net"
--app "ondemand?auth=eaEdQdlbUayd6bLdDbrcZaeatdVaub3bKcVbzbzajbXdyb2c6bebqbtdkdbb1d.cJbB-bpmKkV-eS-6An2IArmDsDs&aifp=v002&slist=production/"
--flashVer "WIN 11,0,1,152"
--swfVfy "http://www.itv.com/mercury/Mercury_VideoPlayer.swf"
--conn Z:
--playpath "mp4:production/priority/CATCHUP/6ccad712/561b/4126/9673/713b489f4d25/1-9502-0033-001_BABAR-AND-THE-ADVENTURES-OF-BADOU_TX270112_ITV1200_16X9.mp4"
-o "C:\Downloads\Babar and the Adventures of Badou - Ruby Rumpus - Episode 33.flv"

TIA
Reply
#24
spoyser Wrote:How would I setup the params to acheive the equivalent of this:

Code:
C:\RTMP\rtmpdump.exe
--rtmp "rtmpe://cp72511.edgefcs.net"
--app "ondemand?auth=eaEdQdlbUayd6bLdDbrcZaeatdVaub3bKcVbzbzajbXdyb2c6bebqbtdkdbb1d.cJbB-bpmKkV-eS-6An2IArmDsDs&aifp=v002&slist=production/"
--flashVer "WIN 11,0,1,152"
--swfVfy "http://www.itv.com/mercury/Mercury_VideoPlayer.swf"
--conn Z:
--playpath "mp4:production/priority/CATCHUP/6ccad712/561b/4126/9673/713b489f4d25/1-9502-0033-001_BABAR-AND-THE-ADVENTURES-OF-BADOU_TX270112_ITV1200_16X9.mp4"
-o "C:\Downloads\Babar and the Adventures of Badou - Ruby Rumpus - Episode 33.flv"

TIA

That finegrained control is currently not done.

It can/will be added for later versions though.

ETA: Currenlty adding this to the trunk. Will the above work with a danish IP? If you give me stuff i can test against, then, well, i can test against it. And make sure it works Smile
Reply
#25
The example will only work from a UK ip address, but if you want to send me the new .py file I'll give it a test
Reply
#26
Replace your ~/.xbmc/addons/script.module.simple.downloader/lib/SimpleDownloader.py with this
http://paste.ubuntu.com/835850/

then you should be able to set all the rtmpdump parameters in the dictionary you give the downloader.

I've used all the full length arguments, (ie, --rtmp not -r) names. so setting { "rtmp": "rtmp://bla", "app": "my_path", "swfVfy": "whatever"} should hopefully work just like it would with the rtmpdump program in a shell.

The only arguments from the man page i have not included, are those under the "Miscellaneous" heading.

NOTE: This is a direct copy from trunk. NOT a backport to 0.9.1
Reply
#27
Not having much luck.

Can you confirm for this:

Code:
C:\RTMP\rtmpdump.exe
--rtmp "rtmpe://cp72511.edgefcs.net"
--app "ondemand?auth=eaEd0dGb3cmdQcwbhdAdhdJd6d4dUaybjapdccubCbcaac0aZdccOcUb5bhdqbTbpb0-bpnpmw-eS-6Ao2HCpmxtyq&aifp=v002&slist=production/"
--flashVer "WIN 11,0,1,152" --swfVfy "http://www.itv.com/mercury/Mercury_VideoPlayer.swf"
--conn Z:
--playpath "mp4:production/CATCHUP/12333f63/0be8/4bf5/a9a7/f01ed13934d7/1-1125-0006-004_THE-ADVENTURES-OF-SHERLOCK-HOLMES_TX260112_ITV800_16X9.mp4"
-o "C:\Download\Sherlock Holmes - A Crooked Man - Episode 5.flv"

I would do this:

Code:
params = {"url"           : "rtmpe://cp72511.edgefcs.net",
              "download_path" : "/download",
              "Title"         : "Sherlock Holmes - A Crooked Man - Episode 5",
              "app"           : "ondemand?auth=eaEd0dGb3cmdQcwbhdAdhdJd6d4dUaybjapdccubCbcaac0aZdccOcUb5bhdqbTbpb0-bpnpmw-eS-6Ao2HCpmxtyq&aifp=v002&slist=production/",
              "flashVer"      : "WIN 11,0,1,152",
              "swfVfy"        : "http://www.itv.com/mercury/Mercury_VideoPlayer.swf",
              "conn"          : "Z:",
              "playpath"      : "mp4:production/CATCHUP/12333f63/0be8/4bf5/a9a7/f01ed13934d7/1-1125-0006-004_THE-ADVENTURES-OF-SHERLOCK-HOLMES_TX260112_ITV800_16X9.mp4",
              "flv"           : "C:\Download\Sherlock Holmes - A Crooked Man - Episode 5.flv"}
    downloader.download("Sherlock Holmes - A Crooked Man - Episode 5.flv", params)

Do I need to wrap anything in extra quotes? Or should the parameters have the - or -- infront of them?
Reply
#28
spoyser Wrote:Not having much luck.

Can you confirm for this:

Code:
C:\RTMP\rtmpdump.exe
--rtmp "rtmpe://cp72511.edgefcs.net"
--app "ondemand?auth=eaEd0dGb3cmdQcwbhdAdhdJd6d4dUaybjapdccubCbcaac0aZdccOcUb5bhdqbTbpb0-bpnpmw-eS-6Ao2HCpmxtyq&aifp=v002&slist=production/"
--flashVer "WIN 11,0,1,152" --swfVfy "http://www.itv.com/mercury/Mercury_VideoPlayer.swf"
--conn Z:
--playpath "mp4:production/CATCHUP/12333f63/0be8/4bf5/a9a7/f01ed13934d7/1-1125-0006-004_THE-ADVENTURES-OF-SHERLOCK-HOLMES_TX260112_ITV800_16X9.mp4"
-o "C:\Download\Sherlock Holmes - A Crooked Man - Episode 5.flv"

I would do this:

Code:
params = {"url"           : "rtmpe://cp72511.edgefcs.net",
              "download_path" : "/download",
              "Title"         : "Sherlock Holmes - A Crooked Man - Episode 5",
              "app"           : "ondemand?auth=eaEd0dGb3cmdQcwbhdAdhdJd6d4dUaybjapdccubCbcaac0aZdccOcUb5bhdqbTbpb0-bpnpmw-eS-6Ao2HCpmxtyq&aifp=v002&slist=production/",
              "flashVer"      : "WIN 11,0,1,152",
              "swfVfy"        : "http://www.itv.com/mercury/Mercury_VideoPlayer.swf",
              "conn"          : "Z:",
              "playpath"      : "mp4:production/CATCHUP/12333f63/0be8/4bf5/a9a7/f01ed13934d7/1-1125-0006-004_THE-ADVENTURES-OF-SHERLOCK-HOLMES_TX260112_ITV800_16X9.mp4",
              "flv"           : "C:\Download\Sherlock Holmes - A Crooked Man - Episode 5.flv"}
    downloader.download("Sherlock Holmes - A Crooked Man - Episode 5.flv", params)

Do I need to wrap anything in extra quotes? Or should the parameters have the - or -- infront of them?

download_path <- Must be c:\Downloads, not just /download

And you shouldn't set flv, the downloader sets a temporary path itself, then moves to the final destination.
Reply
#29
TobiasTheCommie Wrote:download_path <- Must be c:\Downloads, not just /download

And you shouldn't set flv, the downloader sets a temporary path itself, then moves to the final destination.

Cheers for the info, I'll give it a try and let you know how I get on.
Reply
#30
@TobiasTheCommie

Hi - i think amet already mailed you. It seems your script spams our logs (though unwanted i guess).

Code:
ADDON: extension 'downloader/' is not currently supported for service addon

Extension point service needs a "library" attribute. Not sure why you even provide that extension point (downloader isn't a service imho). So either you drop that extension point. Or if its needed (not quiet into it) you have to provide the Library attribute pointing to a .py (no clue again which should that be in your case).

Would be great if you could fix this and do a pr request on the addon mailing list.

Thx

Memphiz
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
[Release] Simple downloader0