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

Error while threading using CLI #67

Open
SeMoOo opened this issue Nov 13, 2024 · 8 comments
Open

Error while threading using CLI #67

SeMoOo opened this issue Nov 13, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@SeMoOo
Copy link

SeMoOo commented Nov 13, 2024

There is an error when using the CLI command for threaded download. The output is:

Error: threaded() got an unexpected keyword argument 'video'.

Default and FFMPEG options work fine.

@EchterAlsFake EchterAlsFake self-assigned this Nov 14, 2024
@EchterAlsFake EchterAlsFake added the bug Something isn't working label Nov 14, 2024
@EchterAlsFake
Copy link
Owner

So I have completely rewritten the CLI since it was very outdated.
Could you please install PHUB from GitHub real quick? You can do this by:

pip uninstall phub
pip install git+https://github.com/EchterAlsFake/PHUB

And then try it again? Please note that since the rewrite some things changed. Please run phub --help to see the new options. Should explain everything by itself (hopefully).

If that doesn't fix the issue or it did (no matter what), please tell me the result. If everything is working so far, I will release the new version of PHUB with those changes to PyPi.

Thank you a lot for reporting this. Would have probably overlooked it for the next 2 years lol.

@EchterAlsFake EchterAlsFake reopened this Nov 14, 2024
@SeMoOo
Copy link
Author

SeMoOo commented Nov 14, 2024

Thanks. It is working perfectly now.

@SeMoOo SeMoOo closed this as completed Nov 14, 2024
@SeMoOo SeMoOo reopened this Nov 14, 2024
@SeMoOo
Copy link
Author

SeMoOo commented Nov 14, 2024

I noticed that the video output codecs are somehow different. Both are .mp4 (MPEG-4) but using ffprone you get two different results. Also the new CLI version output does not work on iOS default player. Using 3rd party apps plays the video but not as smoothly.

@EchterAlsFake
Copy link
Owner

Hi, the issue with the codecs is, because the video segments are .ts files which are used by streaming services. They are all packed together into a .mp4 container, but it's just named mp4. There isn't a real "formatting" process behind it. Most video players will work just fine and since I already fixed that in Porn Fetch I thought that I wouldn't need that anymore, but you are of course totally right.

So my solution would be, that I add a function in PHUB (generally, not just the CLI) to convert every video after downloading to mp4. This would be an optional argument for a user when downloading videos. Converting the videos would need ffmpeg, however, because it's not entirely re-encoded it would basically need almost no time. Probably a process of 2-5 seconds.

Do you think this would be okay?

@SeMoOo
Copy link
Author

SeMoOo commented Nov 14, 2024

Thank you for your prompt response. Well, I am not an expert nor a hardcore programmer but I believe an argument would be a good option. Would like to have a seperate branch for me to test on iOS environment?

@SeMoOo
Copy link
Author

SeMoOo commented Nov 14, 2024

I tried using the argument -downloader FFmpeg, and the video output works fine on iOS (except for default and threaded).

@EchterAlsFake
Copy link
Owner

Okay perfect. I will start implementing it tomorrow, and tell you when it's done :)

EchterAlsFake added a commit that referenced this issue Dec 15, 2024
@EchterAlsFake
Copy link
Owner

Sorry that this took so long, but it's now done.

You can enable FFmpeg converting using:

from phub import Client
video = Client().get_video("some video")
video.download(..... convert=True)

Using the convert argument. By default PHUB will search in your system's path for FFmpeg, but you can define a custom path using consts.FFMPEG_EXECUTABLE

I hope this works so far :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants