Coder Social home page Coder Social logo

cohen3's People

Contributors

cluelessperson avatar dependabot[bot] avatar franknagel avatar gnunicorn avatar htgoebel avatar hypfer avatar kenmacd avatar lalmeras avatar me-minus avatar micxer avatar opacam avatar palfrey avatar phiamo avatar philn avatar sebp avatar tamland avatar unintended avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cohen3's Issues

Cohen3 uses HTTPPageGetter which has been removed from Twisted

Cohen3 won't start with a recent version of Twisted because it uses the Twisted HTTPPageGetter API which has been removed for security reasons.

$ cohen3 -h
Traceback (most recent call last):
  File "/usr/local/bin/cohen3", line 5, in <module>
    from coherence.cli import main
  File "/usr/local/lib/python3.9/site-packages/coherence/cli.py", line 27, in <module>
    from coherence.base import Coherence, Plugins
  File "/usr/local/lib/python3.9/site-packages/coherence/base.py", line 71, in <module>
    from coherence.upnp.core.device import Device, RootDevice
  File "/usr/local/lib/python3.9/site-packages/coherence/upnp/core/device.py", line 32, in <module>
    from coherence.upnp.core import utils
  File "/usr/local/lib/python3.9/site-packages/coherence/upnp/core/utils.py", line 611, in <module>
    class myHTTPPageGetter(client.HTTPPageGetter):
  File "/usr/local/lib/python3.9/site-packages/twisted/python/deprecate.py", line 475, in __getattribute__
    value = getattr(state._module, name)
AttributeError: module 'twisted.web.client' has no attribute 'HTTPPageGetter'

AttributeError: module 'collections' has no attribute 'MutableMapping'

/Users/rich/Library/Python/3.11/bin/cohen3
Traceback (most recent call last):
  File "/Users/rich/Library/Python/3.11/bin/cohen3", line 5, in <module>
    from coherence.cli import main
  File "/Users/rich/Library/Python/3.11/lib/python/site-packages/coherence/cli.py", line 27, in <module>
    from coherence.base import Coherence, Plugins
  File "/Users/rich/Library/Python/3.11/lib/python/site-packages/coherence/base.py", line 62, in <module>
    from eventdispatcher import (
  File "/Users/rich/Library/Python/3.11/lib/python/site-packages/eventdispatcher/__init__.py", line 5, in <module>
    from .dictproperty import DictProperty, ObservableDict
  File "/Users/rich/Library/Python/3.11/lib/python/site-packages/eventdispatcher/dictproperty.py", line 13, in <module>
    class ObservableDict(collections.MutableMapping):
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'collections' has no attribute 'MutableMapping'

'requests.received_headers' with some devices didn't exist.

Using:
cohen3 --plugin=backend:FSStore,content:/media/RouxpiTech

And streaming some content will fail with:
File "/home/RouxpiTech/.local/lib/python3.6/site-packages/coherence/upnp/devices/media_server.py", line 388, in process_child del request.received_headers[b'content-length'] builtins.AttributeError: 'Request' object has no attribute 'received_headers'

I have tested with other devices, and this error only happens on some devices.

It fails with Samsung TVs
And it was succesfull in iOS.

Missing configuration file may break CLI

Cohen3.base.log_level breaks here if you use the CLI interface in non daemon mode and without a configuration file (or without a proper logging section). You will get an builtins.AttributeError: 'Section' object has no attribute 'upper' exception.

The reason for this behavior is, that you unconditionally add a loggging section in cli.py but only in daemon mode do you add a level attribute a few lines later.

fs_storage.py - re.error: bad character range u-S at position 36

Python 3.8.2

root@aspen:/opt/docker/services/cohen3# docker-compose up
Starting cohen3_cohen3_1 ... done
Attaching to cohen3_cohen3_1
cohen3_1  | [WARNING][coherence      ]  Coherence UPnP framework version 0.9.3 starting [log level: warning]...    (base.py:522)
cohen3_1  | [WARNING][webserver      ]  WebServer on ip http://10.40.16.5:8080 ready    (base.py:197)
cohen3_1  | [WARNING][fs_item        ]  Traceback (most recent call last):
cohen3_1  |   File "/usr/local/lib/python3.8/site-packages/coherence/backends/fs_storage.py", line 292, in __init__
cohen3_1  |     filename, mimetype, dlna_pn = _find_thumbnail(
cohen3_1  |   File "/usr/local/lib/python3.8/site-packages/coherence/backends/fs_storage.py", line 107, in _find_thumbnail
cohen3_1  |     for f in glob.glob(pattern):
cohen3_1  |   File "/usr/local/lib/python3.8/glob.py", line 21, in glob
cohen3_1  |     return list(iglob(pathname, recursive=recursive))
cohen3_1  |   File "/usr/local/lib/python3.8/glob.py", line 74, in _iglob
cohen3_1  |     for name in glob_in_dir(dirname, basename, dironly):
cohen3_1  |   File "/usr/local/lib/python3.8/glob.py", line 85, in _glob1
cohen3_1  |     return fnmatch.filter(names, pattern)
cohen3_1  |   File "/usr/local/lib/python3.8/fnmatch.py", line 52, in filter
cohen3_1  |     match = _compile_pattern(pat)
cohen3_1  |   File "/usr/local/lib/python3.8/fnmatch.py", line 46, in _compile_pattern
cohen3_1  |     return re.compile(res).match
cohen3_1  |   File "/usr/local/lib/python3.8/re.py", line 250, in compile
cohen3_1  |     return _compile(pattern, flags)
cohen3_1  |   File "/usr/local/lib/python3.8/re.py", line 302, in _compile
cohen3_1  |     p = sre_compile.compile(pattern, flags)
cohen3_1  |   File "/usr/local/lib/python3.8/sre_compile.py", line 764, in compile
cohen3_1  |     p = sre_parse.parse(p, flags)
cohen3_1  |   File "/usr/local/lib/python3.8/sre_parse.py", line 948, in parse
cohen3_1  |     p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
cohen3_1  |   File "/usr/local/lib/python3.8/sre_parse.py", line 443, in _parse_sub
cohen3_1  |     itemsappend(_parse(source, state, verbose, nested + 1,
cohen3_1  |   File "/usr/local/lib/python3.8/sre_parse.py", line 834, in _parse
cohen3_1  |     p = _parse_sub(source, state, sub_verbose, nested + 1)
cohen3_1  |   File "/usr/local/lib/python3.8/sre_parse.py", line 443, in _parse_sub
cohen3_1  |     itemsappend(_parse(source, state, verbose, nested + 1,
cohen3_1  |   File "/usr/local/lib/python3.8/sre_parse.py", line 598, in _parse
cohen3_1  |     raise source.error(msg, len(this) + 1 + len(that))
cohen3_1  | re.error: bad character range u-S at position 36
cohen3_1  |     (fs_storage.py:297)

I'll gladly support the docker implementation as well. ;)

Publish official public Docker image

As now there is a Dockerfile, it feels natural to have one.
Using Github Actions it is possible easily. Commits to master can build automatically the image and push it to Docker Hub. I can help, if needed.
Prerequisite: a Docker Hub free account and an existing empty image/repo there.

How does one get the cohen3 command in path?

I installed via pip / user install per the README, but get:

cohen3                                                                                              
zsh: command not found: cohen3
pip3 list -v | grep coh
cohen3                        0.9.3                                                                 /Users/rich/Library/Python/3.10/lib/python/site-packages    pip

But I don't see an actual binary or anything named cohen3 in that dir.

Not sure what I'm missing.

[rich:~/Dropbox/cohen-dnla]$ pip3 -V
pip 22.2.2 from /opt/homebrew/lib/python3.10/site-packages/pip (python 3.10)

[rich:~/Dropbox/cohen-dnla]$ echo $PATH
/opt/homebrew/lib/python3.10/site-packages/pip:/Users/rich/Library/Python/3.10/lib/python/site-packages:/opt/homebrew/opt/node@16/bin:/usr/local/bin:/usr/local/sbin:/Users/rich/bin:/Users/rich/.poetry/bin:/usr/local/opt/libpq/bin:/usr/local/Cellar/ruby/2.7.1_2/bin/gem:/usr/local/opt/ruby/bin:/Users/rich/.krew/bin:/Users/rich/Library/Python/3.7/bin/:/usr/local/opt/mysql-client/bin:/usr/local/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/rich/.pub-cache/bin

ModuleNotFoundError: No module named 'clock'

Installing the latest version using:

pip install https://github.com/opacam/Cohen3/archive/master.zip

will fail with:

  Downloading https://files.pythonhosted.org/packages/a2/37/f46636488468b8c30d7a59be471fdd9fb84b82ca3d770fe819e815bec65d/eventdispatcher-1.81.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-dvxm4cem/eventdispatcher/setup.py", line 4, in <module>
        from eventdispatcher import __version__
      File "/tmp/pip-install-dvxm4cem/eventdispatcher/eventdispatcher/__init__.py", line 12, in <module>
        from .scheduledevent import ScheduledEvent
      File "/tmp/pip-install-dvxm4cem/eventdispatcher/eventdispatcher/scheduledevent.py", line 8, in <module>
        from clock import Clock
    ModuleNotFoundError: No module named 'clock'
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-dvxm4cem/eventdispatcher/

Youtube Storage not working

The google's api used for the original project is not working anymore with youtube, google shutdown the old api and has released a new api with oauth authorization, new urls...

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.