e2iplayer / hlsdl

Project has been closed - please start to use different branch / C program to download VOD and LIVE HLS (.m3u8) streams
MIT License
41 stars 6 forks source link

32-bit (x86) binaries, please? #5

Closed Vangelis66 closed 5 years ago

Vangelis66 commented 5 years ago

Hello, many thanks for this excellent project/fork and efforts 👍

However, I am on Windows Vista SP2 (32-bit), fully updated with post EOL MS updates (intended for Server 2008 SP2), .Net Framework 4.6.1 (fully updated) and I'd like to test this; unfortunately, you are only providing 64-bit compiled binaries... 😭

Would you be so kind as to recompile for the 32-bit architecture and also target NT 6.0 kernel? Thanks in anticipation...

OT: May you have the Happiest New Year, too! ❤️

e2iplayer commented 5 years ago

You can find instruction how to compile for windows. I do not have such configuration, so it is hard to me to compile it.

https://github.com/e2iplayer/hlsdl/blob/master/msvc/BUID_WINDOWS.txt

Vangelis66 commented 5 years ago

Thank you for your swift reply, especially during the holiday period, however:

  1. I am not at all versed in compiling OS code, with VS or other compilers...
  2. This is a fairly old laptop, not suitable for installing toolchains and compiling code (2007 era Core2Duo, 3GB RAM, latest version of VS that could be installed is 2010...

I do not have such configuration, so it is hard to me to compile it.

AIUI, 64-bit compilers (on 64-bit hosts) are also able to compile 32-bit binaries via simple configuration changes...

https://github.com/e2iplayer/hlsdl/blob/master/msvc/BUID_WINDOWS.txt

Thanks, but I have already been there prior to creating this issue...

vcvarsall.bat" x64 (snip) MACHINE=x64

Perhaps using vcvarsall.bat" x86 and targeting MACHINE=x86 would be the way to go (again, I'm not able to test myself...)? FWIW, all dependencies (cmake, openssl-1.1.0f, pthreads, curl) are already available as win32 flavours...

Please, don't give up so easily on us, on 32-bit OSes...

@Reino17 I have been using, with success, your win32 binary of the original project, could you, perhaps, take a look at this [or we could continue this discussion over at the MSFN forums, CoRoNe...]?

Thanks to any person that can provide win32 builds...

e2iplayer commented 5 years ago

To be able to compile for Vista you need old SDK. So, compilation only for the 32-bit unfortunately do not make the job.

Reino17 commented 5 years ago

I'm sorry, but I can't be of any help this time. Compiling hlsdl (e2iplayer):

src/hls.c:10:10: fatal error: sys/prctl.h: No such file or directory
 #include <sys/prctl.h>
          ^~~~~~~~~~~~~
compilation terminated.
make: *** [makefile:36: src/hls.o] Error 1

Compiling hlsdl (selsta):

/cygdrive/[...]/cross_compilers/mingw-w64-i686/bin/i686-w64-mingw32-gcc src/main.o src/aes.o src/curl.o src/hls.o src/misc.o src/msg.o -L/cygdrive/[...]/cross_compilers/mingw-w64-i686/i686-w64-mingw32/lib -lcurl -lmbedtls -lmbedx509 -lmbedcrypto -lwldap32 -lz -lws2_32 -lavformat -lm -lws2_32 -lavcodec -pthread -lm -lavutil -pthread -lm -luser32 -ladvapi32 -o hlsdl
/cygdrive/[...]/cross_compilers/mingw-w64-i686/lib/gcc/i686-w64-mingw32/8.2.0/../../../../i686-w64-mingw32/bin/ld: src/hls.o: in function `decrypt_sample_aes':
/cygdrive/[...]/win32/hlsdl_git/src/hls.c:489: undefined reference to `memmem'
/cygdrive/[...]/cross_compilers/mingw-w64-i686/lib/gcc/i686-w64-mingw32/8.2.0/../../../../i686-w64-mingw32/bin/ld: /cygdrive/[...]/win32/hlsdl_git/src/hls.c:493: undefined reference to `memmem'
/cygdrive/[...]/cross_compilers/mingw-w64-i686/lib/gcc/i686-w64-mingw32/8.2.0/../../../../i686-w64-mingw32/bin/ld: /cygdrive/[...]/win32/hlsdl_git/src/hls.c:505: undefined reference to `memmem'
/cygdrive/[...]/cross_compilers/mingw-w64-i686/lib/gcc/i686-w64-mingw32/8.2.0/../../../../i686-w64-mingw32/bin/ld: /cygdrive/[...]/win32/hlsdl_git/src/hls.c:518: undefined reference to `memmem'
collect2: error: ld returned 1 exit status
make: *** [makefile:25: all] Error 1

Especially this one I find annoying, because it has worked before. I don't understand why it won't work now.

e2iplayer commented 5 years ago

Hello @Vangelis66,

Please try this release: https://github.com/e2iplayer/hlsdl/releases/download/hlsdlv0.24/hlsdlv0.24-x86-mingw32-static.zip

Regards, SSS

Vangelis66 commented 5 years ago

@e2iplayer

After our previous discussion here, I had almost lost all hope for a win32 binary :cry:, so this new development comes twice as nice! This is extremely appreciated 🥇 , once more the saying all good things come to those who wait turned true!

More to the point, I can confirm the released binary loads and runs fine in my Vista SP2 32-bit laptop:

hlsdl v0.24
(c) 2017-2018 samsamsam@o2.pl based on @selsta code
Usage: hlsdl url [options]

-b ... Automaticly choose the best quality.
-v ... Verbose more information.
-o ... Choose name of output file.
-u ... Set custom HTTP User-Agent header.
-h ... Set custom HTTP header.
-p ... Set proxy uri.
-k ... Allow to replace part of AES key uri - old.-n ... Allow to replace part o
f AES key uri - new.-f ... Force overwriting the output file.
-q ... Print less to the console.
-d ... Print the openssl decryption command.
-t ... Print the links to the .ts files.
-s ... Set live start offset in seconds.
-e ... Set refresh delay in seconds.
-r ... Set max retries at open.
-w ... Set max download segment retries.
-a ... Set additional url to the audio media playlist.
-c ... Threat HTTP code 206 as 200 even if request was made without range header
.

While extremely thankful, please allow for some nit-picking on my part:

(c) 2017-2018: We're well into 2019 already, perhaps changed to either (c) 2017-2019 or, better yet, (c) 2017-present

-k ... Allow to replace part of AES key uri - old.-n ... Allow to replace part o
f AES key uri - new.-f ... Force overwriting the output file.

This is how Windows command prompt prints the above, so obviously something went awry; different switches should use new lines, hopefully it'll be made to print like:

-k ... Allow to replace part of AES key uri - old.
-n ... Allow to replace part of AES key uri - new.
-h ... Set custom HTTP header.

... Using CLIs all those years, I always thought -h was short for --help, the ubiquitous help switch; well, I was wrong about this one!

-c ... Threat HTTP code 206 as 200 even if request was made without range header

A small typo there, "Threat" => Treat

After having read #13, I decided to try the app on a BBC iPlayer VOD (pid=m0001vjf, mediaselector API URL http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/apple-ipad-hls/vpid/m0001vjd), at first I thought I had to issue the command like this

hlsdl -p "http://www.englandproxy.co.uk/" "http://mm.bidi.bbc.co.uk/vod-hls-uk-live/usp/auth/vod/piff_abr_full_sd/5da0a3-m0001vjd/vf_m0001vjd_599f25ef-ed3d-42d7-8211-a170734a9128.ism.hlsv2.ism/iptv_hd_abr_v1_hls_master.m3u8?at=pk4BbEciefc05ca078492de3963ae591ce9512d4d25aa2d75808d1e8f38c0" -o "TOTP2_NewYearsEveSpecial_201812312200[m0001vjf].ts"

but it wouldn't work... After some experimentation, I realised I had to issue

hlsdl "http://www.englandproxy.co.uk/vod-hls-uk-live.akamaized.net/usp/auth/vod/piff_abr_full_sd/5da0a3-m0001vjd/vf_m0001vjd_599f25ef-ed3d-42d7-8211-a170734a9128.ism/mobile_wifi_main_sd_abr_v2_hls_master.m3u8?__gda__=1548741514_25520227e518e08ca85ef99fdab6b5fd" -o "TOTP2_NewYearsEveSpecial_201812312200[m0001vjf].ts"

which did work! I haven't yet tried to fetch an AES-128 encrypted playlist; as for SAMPLE-AES, on its own it's almost never used, most of the times as part of Apple Fairplay DRM, which, of course, hasn't been cracked and thus is not supported by hlsdl (or any other app, for that matter...).

I am inclined to close this issue if I get reassured win32 binaries are to be made part of regular releases; while win64 is obviously the way to go, many Windows users are still on 32-bit installs (obviously those XP-diehards and some Vista32 users like myself), including Win7 and Win10 OSes still under M$ support; these installations are, more often than not, OS upgrades from XP/Vista on older hardware with limited RAM (<=4GB), where a x86 OS is the best choice there... Let us not forget that quite complex software like web browsers and media players are still being compiled and offered as x86 executables, in my coding ignorance I found it peculiar a seemingly simpler program like hlsdl wasn't... 😉

Again, a surplus of thanks to the dev! 👍

e2iplayer commented 5 years ago

Hello,

You welcome.

(c) 2017-2018: We're well into 2019 already, perhaps changed to either (c) 2017-2019 or, better yet, (c) 2017-present [...] This is how Windows command prompt prints the above, so obviously something went awry; different switches should use new lines, hopefully it'll be made to print like: [...] A small typo there, "Threat" => Treat

I will fix this. Thanks

... Using CLIs all those years, I always thought -h was short for --help, the ubiquitous help switch; well, I was wrong about this one!

I agree that this is not standard usage of this switch, but you must know that hlsdl in my case is not used by hand it is utility used in the different project and called automatically. That's why I can not change it easily now.

After having read #13, I decided to try the app on a BBC iPlayer VOD (pid=m0001vjf, mediaselector API URL ...), at first I thought I had to issue the command like this ... but it wouldn't work... After some experimentation, I realised I had to issue

This was ugly workaround, when I will have some free time I will try to implement something more common for web proxy gate use.

which did work! I haven't yet tried to fetch an AES-128 encrypted playlist; as for SAMPLE-AES, on its own it's almost never used, most of the times as part of Apple Fairplay DRM, which, of course, hasn't been cracked and thus is not supported by hlsdl (or any other app, for that matter...).

For example https://de.eurosportplayer.com/ use SAMPLE-AES without DRM. Authorization is based on cookie header.

Let us not forget that quite complex software like web browsers and media players are still being compiled and offered as x86 executables, in my coding ignorance I found it peculiar a seemingly simpler program like hlsdl wasn't... wink

Do not compare this small project to many coders involved with browser development and release. As I already wrote hlsdl is used by me as one of many small utilities in diffrent project and I not use version compiled for windows at all.

I created solution for Visual Studio to because it is very powerful debugging tool and make development easier. To be able to compile for 32-bit for old system I must create whole mingw32 enviroment which generally will not be used by me at all.

Regards, SSS

e2iplayer commented 5 years ago

Do you have any further questions? If not please close this issue.