Git Product home page Git Product logo

Comments (9)

glubsy avatar glubsy commented on July 1, 2024

I suspect that you have a /home/hobbes/livestream_saver/ directory alongside your /home/hobbes/livestream_saver.py which confuses python. If that is the case, delete or move that directory (better yet, move everything inside that directory instead).

from livestream_saver.

hbbernardo avatar hbbernardo commented on July 1, 2024

I moved everything into a new directory called livestream. To no avail.

ls livestream/
livestream_saver.py requirements.txt

~/livestream$ python3.8 livestream_saver.py monitor --help
Traceback (most recent call last):
File "livestream_saver.py", line 12, in
from livestream_saver import extract, util
File "/home/hobbes/livestream/livestream_saver.py", line 12, in
from livestream_saver import extract, util
ImportError: cannot import name 'extract' from partially initialized module 'livestream_saver' (most likely due to a circular import) (/home/hobbes/livestream/livestream_saver.py)

Doing the requirements part I noticed that this error happened:

Traceback (most recent call last):
File "/tmp/pip-build-9vmxvr2s/Pillow/setup.py", line 995, in
setup(
File "/usr/lib/python3/dist-packages/setuptools/init.py", line 129, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/usr/lib/python3.8/distutils/command/install.py", line 589, in run
self.run_command('build')
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3.8/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", lin e 78, in run
_build_ext.run(self)
File "/usr/lib/python3.8/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/tmp/pip-build-9vmxvr2s/Pillow/setup.py", line 810, in build_extensi ons
raise RequiredDependencyException(f)
main.RequiredDependencyException: jpeg

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-9vmxvr2s/Pillow/setup.py", line 1012, in <module>
    raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:

The headers or library files could not be found for jpeg,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html



----------------------------------------

Command "/usr/bin/python3.8 -u -c "import setuptools, tokenize;file='/tmp/pi p-build-9vmxvr2s/Pillow/setup.py';f=getattr(tokenize, 'open', open)(file);co de=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec') )" install --record /tmp/pip-d3g7d0hv-record/install-record.txt --single-version -externally-managed --compile --user --prefix=" failed with error code 1 in /tmp /pip-build-9vmxvr2s/Pillow/

Any ideas?

from livestream_saver.

glubsy avatar glubsy commented on July 1, 2024

There is something wrong with your setup.

You might want to look into setting up a virtual environment as is described in the Readme, then install dependencies in that virtual environment with pip.

Can you confirm you have the exact same directory structure as in this here repository?
Beyond that I don't know why this is occurring.

from livestream_saver.

hbbernardo avatar hbbernardo commented on July 1, 2024

I did a clean install of Raspberry Pi OS on a new SDCard.

The only thing I installed was python-pip. Nothing else.

hbs@raspberrypi:~/livestream $ python3.9 -m pip install -r requirements.txt Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: pytube==10.9.2 in /home/hbs/.local/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (10.9.2)
Requirement already satisfied: Pillow in /usr/lib/python3/dist-packages (from -r requirements.txt (line 2)) (8.1.2)

When I tried to run, the same thing happened.

hbs@raspberrypi:~/livestream $ python3.9 livestream_saver.py download --cookie cookie.txt https://www.youtube.com/watch?v=86YLFOog4GM
Traceback (most recent call last):
File "/home/hbs/livestream/livestream_saver.py", line 12, in
from livestream_saver import extract, util
File "/home/hbs/livestream/livestream_saver.py", line 12, in
from livestream_saver import extract, util
ImportError: cannot import name 'extract' from partially initialized module 'livestream_saver' (most likely due to a circular import) (/home/hbs/livestream/livestream_saver.py)

This is what is inside my home user:

image

from livestream_saver.

glubsy avatar glubsy commented on July 1, 2024

I managed to reproduce this by not having a livestream_saver directory alongside livestream_saver.py. You need to have the same directory structure as is in the repository and I suspect you are missing files for some reason. How have you cloned the repository?
You need to have all files:

~/livestream/livestream_saver.py
~/livestream/...
~/livestream/livestream_saver/
~/livestream/livestream_saver/__init__.py
~/livestream/livestream_saver/...

from livestream_saver.

hbbernardo avatar hbbernardo commented on July 1, 2024

I was able to fix it.

It started downloading a live stream but at a certain point, it stopped with an error. This was on a Ubuntu machine. The first one i mentioned above.

python3.8 livestream_saver.py download --log-level CRITICAL --cookie ~hbs/cookie.txt https://www.youtube.com/watch?v=V9rlTQCg0Ow
2022-11-18 01:30:09,325 - CRITICAL - livestream_saver.request - We are not logged in. Check the validity of your cookies!

2022-11-18 01:11:16,648 - CRITICAL - download.V9rlTQCg0Ow - Some kind of error occured during download? Stream format mismatch after update of base URL.

What it is missing?

from livestream_saver.

glubsy avatar glubsy commented on July 1, 2024

The path to your cookie.txt file is wrong, it should be ~/hbs/cookies.txt.

The error you got is a known issue.
You can circumvent the problem by using the --ignore-quality-change argument. It's not documented in the Readme yet, because it might not work reliably. There is still some work to be done.

from livestream_saver.

hbbernardo avatar hbbernardo commented on July 1, 2024

For the last week up to today, I've been using this option trying to salvage my live streams on YouTube to no avail

All of them ended with an error right in the middle saying that a mismatch occurred. Nothing could be saved.

I tried to concatenate another live stream that I captured that I did only for testing purposes which also ended in a mismatch. I ended up canceling the action because even on my remote server it took more than a day to end.

I must apologize because I don't have any logs to show as of now. I deleted the whole thing to start over.

But tomorrow and on I will be able to provide some. I've left livestream_stream saver monitoring a YouTube channel. The same one and the only one that I am trying to capture since the very beginning.

I've used this; python3 livestream_saver.py monitor --ignore-quality-change -d --scan-delay 30 URL

I did a git pull and everything seems to be up-to-date.

from livestream_saver.

glubsy avatar glubsy commented on July 1, 2024

Yeah, I had that error come up randomly but it seems to occur more with certain streamers than others. Not sure why exactly but I'll try to handle it better in future versions.

Another thing you might want to do is automatically start a side-car application to record your live streams, like yt-dlp for example. You can use the hooks described in "hooks on event" section in the Readme.

from livestream_saver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.