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

Youtube dl to yt dlp #1840

Merged
merged 5 commits into from
Dec 27, 2023
Merged

Conversation

schwingm
Copy link
Contributor

No description provided.

@schwingm schwingm requested a review from a team as a code owner November 21, 2023 08:00
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@schwingm
Copy link
Contributor Author

Fixes #1779

@vpetersson
Copy link
Contributor

Thanks @schwingm.
Can you please review and test this @nicomiguelino?

@nicomiguelino
Copy link
Contributor

nicomiguelino commented Nov 23, 2023

Great work! @schwingm

@schwingm, @vpetersson
I tested this on a Raspberry Pi 4 (Model B) running a 64-bit Raspberry Pi OS Lite (Bullseye). It's working — Anthias is able to download the videos on the device.

There's one front-end nitpick though — After saving the URL asset (which is a YouTube link), the Activity (status) of the asset stays at "Asset in processing", unless the page's refreshed.

image

Here's what I got from the server logs (from the anthias-server service):

What I got after submitting a (YouTube) URL asset:

screenly-anthias-server-1  | Deprecated Feature: Support for Python version 3.7 has been deprecated. See  https://github.com/yt-dlp/yt-dlp/issues/7803  for details.
screenly-anthias-server-1  |                     You may stop receiving updates on this version at any time! Please update to Python 3.8 or above
screenly-anthias-server-1  | Deprecated Feature: Support for Python version 3.7 has been deprecated. See  https://github.com/yt-dlp/yt-dlp/issues/7803  for details.
screenly-anthias-server-1  |                     You may stop receiving updates on this version at any time! Please update to Python 3.8 or above
screenly-anthias-server-1  | Deprecated Feature: Support for Python version 3.7 has been deprecated. See  https://github.com/yt-dlp/yt-dlp/issues/7803  for details.
screenly-anthias-server-1  |                     You may stop receiving updates on this version at any time! Please update to Python 3.8 or above
screenly-anthias-server-1  | [youtube] Extracting URL: https://www.youtube.com/watch?v=fJ9rUzIMcZQ
screenly-anthias-server-1  | [youtube] fJ9rUzIMcZQ: Downloading webpage
screenly-anthias-server-1  | [youtube] fJ9rUzIMcZQ: Downloading ios player API JSON
screenly-anthias-server-1  | [youtube] fJ9rUzIMcZQ: Downloading android player API JSON
screenly-anthias-server-1  | [youtube] fJ9rUzIMcZQ: Downloading m3u8 information
screenly-anthias-server-1  | [info] fJ9rUzIMcZQ: Downloading 1 format(s): 22
screenly-anthias-server-1  | [download] Destination: /data/screenly_assets/5a42f5172456482b98c2e1ba8551bf31
[download] 100% of   39.12MiB in 00:00:04 at 8.60MiB/s

What I got after refreshing the page:

screenly-anthias-server-1  | Exception in thread Thread-3:
screenly-anthias-server-1  | Traceback (most recent call last):
screenly-anthias-server-1  |   File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
screenly-anthias-server-1  |     self.run()
screenly-anthias-server-1  |   File "/usr/src/app/lib/utils.py", line 327, in run
screenly-anthias-server-1  |     publisher.send_to_ws_server(self.asset_id)
screenly-anthias-server-1  |   File "/usr/src/app/settings.py", line 175, in send_to_ws_server
screenly-anthias-server-1  |     self.socket.send("ws_server {}".format(msg))
screenly-anthias-server-1  |   File "/usr/local/lib/python3.7/dist-packages/zmq/sugar/socket.py", line 416, in send
screenly-anthias-server-1  |     return super(Socket, self).send(data, flags=flags, copy=copy, track=track)
screenly-anthias-server-1  |   File "zmq/backend/cython/socket.pyx", line 728, in zmq.backend.cython.socket.Socket.send
screenly-anthias-server-1  |   File "zmq/backend/cython/socket.pyx", line 772, in zmq.backend.cython.socket.Socket.send
screenly-anthias-server-1  | TypeError: unicode not allowed, use send_string
screenly-anthias-server-1  |
screenly-anthias-server-1  | Remote Git branch not available
screenly-anthias-server-1  | Unable to get latest version from GitHub


^Ccanceled
➜  

Copy link
Contributor

@nicomiguelino nicomiguelino left a comment

Choose a reason for hiding this comment

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

Looks like it's working, but there's still problems with the websocket.

@schwingm
Copy link
Contributor Author

Thank you!

I believe the issue is within settings.py

self.socket.send("ws_server {}".format(msg))

might need to be changed to

self.socket.send("ws_server {}".format(msg).encode())

I will make this modification and test.

@nicomiguelino
Copy link
Contributor

Thanks too! Got the same error on a Pi 3 B+ (using a 64-bit Bullseye). Let me try the changes if it'll work.

@nicomiguelino
Copy link
Contributor

@schwingm, I tried send_string. Looks like the error is gone.

screenly-anthias-server-1  | Deprecated Feature: Support for Python version 3.7 has been deprecated. See  https://github.com/yt-dlp/yt-dlp/issues/7803  for details.
screenly-anthias-server-1  |                     You may stop receiving updates on this version at any time! Please update to Python 3.8 or above
screenly-anthias-server-1  | Deprecated Feature: Support for Python version 3.7 has been deprecated. See  https://github.com/yt-dlp/yt-dlp/issues/7803  for details.
screenly-anthias-server-1  |                     You may stop receiving updates on this version at any time! Please update to Python 3.8 or above
screenly-anthias-server-1  | Deprecated Feature: Support for Python version 3.7 has been deprecated. See  https://github.com/yt-dlp/yt-dlp/issues/7803  for details.
screenly-anthias-server-1  |                     You may stop receiving updates on this version at any time! Please update to Python 3.8 or above
screenly-anthias-server-1  | [youtube] Extracting URL: https://www.youtube.com/watch?v=LXb3EKWsInQ
screenly-anthias-server-1  | [youtube] LXb3EKWsInQ: Downloading webpage
screenly-anthias-server-1  | [youtube] LXb3EKWsInQ: Downloading ios player API JSON
screenly-anthias-server-1  | [youtube] LXb3EKWsInQ: Downloading android player API JSON
screenly-anthias-server-1  | [youtube] LXb3EKWsInQ: Downloading m3u8 information
screenly-anthias-server-1  | [info] LXb3EKWsInQ: Downloading 1 format(s): 22
screenly-anthias-server-1  | [download] Destination: /data/screenly_assets/339e309a0e6c498d97707f06ca968e94
[download] 100% of   60.93MiB in 00:00:09 at 6.60MiB/s




screenly-anthias-server-1  | Remote Git branch not available
screenly-anthias-server-1  | Unable to get latest version from GitHub

However, a manual page refresh is still needed before enabling the newly-added YouTube asset (as it still displays "Asset in processing").

@nicomiguelino nicomiguelino merged commit b109dc1 into Screenly:master Dec 27, 2023
@nicomiguelino
Copy link
Contributor

nicomiguelino commented Dec 27, 2023

@schwingm, I already merged this PR since your changes worked.
The follow-up fixes that you mentioned before can be put in a separate PR.

About the asset status stuck in Asset in processing, a new issue was created: #1901

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 this pull request may close these issues.

3 participants