Coder Social home page Coder Social logo

azatoth / minidlna Goto Github PK

View Code? Open in Web Editor NEW
284.0 284.0 79.0 1.71 MB

MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully compliant with DLNA/UPnP-AV clients. It is developed by a NETGEAR employee for the ReadyNAS product line

Home Page: http://sourceforge.net/projects/minidlna/

License: Other

C 99.92% Shell 0.08%

minidlna's People

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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minidlna's Issues

need to restart minidlnad for using with Panasonic TV

Have been using minidlna for years on a raspi 3 and now rpi4 w/o any issues.
It works well on access from remote unix or win pc.

However, once I want to stream from a Panasonic TV, it doesn't find any dlna server in my intranet.
What makes the matter even more obscure, a restart of the minidlna server solves the problem and all streams as expected.

Do I switch off/on the TV, I need to restart the minidlna service again.

It worked for years with this Panasonic TV.
A reinstallation of the minidlna package didnt changed anything.

Any ideas or suggestions?

Thanks
V.

minidlna does not index all files

I have a directory with 2377 mp3 files, but minidlna will only index 799 of them. There are no errors in the log for specific files (log level warn). There is this SQL error but I am not sure if it is related, since it is shown after scanning has finished:

sql.c:117: warn: sql_get_int_field: step failed: SQL logic error or missing database
SELECT (select count(distinct DETAIL_ID) from OBJECTS o left join DETAILS d on (o.DETAIL_ID = d.ID) where (OBJECT_ID glob '*$*') and (o.CLASS like "item.audioItem%" and REF_ID is NULL)) + (select count(*) from OBJECTS o left join DETAILS d on (o.DETAIL_ID = d.ID) where (OBJECT_ID = '*') and (o.CLASS like "item.audioItem%" and REF_ID is NULL))

All files and directories are readable by the minidlna user.
The problem occures in 1.1.5 and 1.2.1.

Any idea how to find out why these files are ignored (and how to fix it)?

Strange behavior with Firewall

I have a firewall on a debian machine preventing internet traffic through anything other than the TUN I have set up through openpvp, EXCLUDING local network traffic, so I can still SSH the box and theoretically should be able to access MiniDLNA:

#Allow loopback device (internal communication)
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

#Allow all local traffic.
iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT
iptables -A OUTPUT -d 192.168.1.0/24 -j ACCEPT


#Allow VPN establishment
iptables -A OUTPUT -p udp --dport 1194 -j ACCEPT
iptables -A INPUT -p udp --sport 1194 -j ACCEPT

#Allow traffic to uk and hk PIA server to reconnect VPN in case of failure
iptables -A INPUT -s uk-london.privateinternetaccess.com -j ACCEPT
iptables -A OUTPUT -d uk-london.privateinternetaccess.com -j ACCEPT
iptables -A INPUT -s  hk.privateinternetaccess.com -j ACCEPT
iptables -A OUTPUT -d hk.privateinternetaccess.com -j ACCEPT
#Allow traffic to PIA DNS
iptables -A INPUT -s 209.222.18.222 -j ACCEPT
iptables -A OUTPUT -d 209.222.18.222 -j ACCEPT

#Accept all TUN connections (tun = VPN tunnel)
iptables -A OUTPUT -o tun+ -j ACCEPT
iptables -A INPUT -i tun+ -j ACCEPT

#Set default policies to drop all communication unless specifically allowed
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

That script works great, I fire it on the servers bootup via /etc/rc.local (it's a debian system). But when I run DLNA that's in the sources.list, I can't connect to the server from other devices. Upon inspection of the logfile, I see something that I can readily make sense of.

[2014/10/18 19:53:29] minissdp.c:335: error: sendto(udp_notify=7, 192.168.1.2): Operation not permitted

I tried compiling but can't get things to work with the init script for some reason. Anyway, does anyone have any suggestions?

Synology DSM 7.0 does not run the miniDLNA package

After upgrade to DSM 7.0-41890 version the miniDLNA package failed to start, not gets installed. I hope many people would be needing this package back in working condition and hence request Mr. Justin Maggard to look at fixing this

Run as (-u)

Hi,

was the -u option omitted intentionally?

Feature request | Exclude some folders.

Hi,

My minidlna.conf have a few media_dir options something like this

media_dir=V,/opt/Torrents
media_dir=V,/home/anton/Downloads

But i want exclude few folders from /home/anton/Downloads and I suggest add exclude_folder options to config file. Full path, or mask, or regexp - not important..

exclude_folder=/home/anton/Downloads/TempVideo
or
exclude_folder=/home/anton/Downloads/temp*

HTML / CSS Facelift for Web UI

I appreciate the "just the facts" approach of the web UI, but think it would benefit from an HTML / CSS update. I have another issue posting regarding the UI providing file names in files.db. Should that be implemented, an HTML / CSS update could keep a page having additional content more manageable.

I have seen a couple of other projects that do this or add restart, rescan functionality to the UI. I'm wondering if at least some of this could / should be native to the MiniDLNA app. If not, I'm happy to contribute to those projects or perhaps attempt a new direction.

Thanks!

run-as fails with authority problems

It user=nobody set in the config files, minidlnad fails to start.
To fix, as far as I can tell, the directories / files:
/var/run/minidlnad.pid
/var/log/minidlna
/var/log/minidlna/*
/var/cache/minidlna
/var/cache/minidlna/*
all need ownership nobody:root & group read (or read+execute for directories)

Inotify add new subtitle

I found bug in SQL statement in method check_for_captions in metadata.c file. If subtitle filename is for example:
How.I.Met.Your.Mother.S07E07.HDTV.XviD-LOL.[VTV].avi
There won't be any result in database, because glob function which is use in sql statment will interpret [VTV] as range pattern and glob function in sqlite hasn't escape character.

How to compile?

The README suggest to look into INSTALL for instructions; unfortunately there is none.

However - configure always fails for me with
configure: error: Could not find libavformat - part of ffmpeg

I installed libavformat-dev, I even built it myself, still this error persists. Any idea how to get rid of it?

Potential Integer Overflow vulnerability in upnphttp.c

Hi,
It seems that there exists a potential integer overflow. Please find the following description:

  1. n can be an arbitrary large number

    n = recv(h->socket, buf, 2048, 0);

  2. h->req_buflen is added to n

    h->req_buflen += n;

  3. Process_upnphttp(...) is called again

    Process_upnphttp(e);

  4. Call to realloc with the large integer can cause a memory allocation with an overflowed size

    h->req_buf = (char *)realloc(h->req_buf, n + h->req_buflen);

segfault " in select_del" while streaming

Hello,
i'm using minidlna 1.3.2. I'm getting many segfaults while streaming movie, this is backtrace:

Reading symbols from /usr/sbin/minidlnad...
Reading symbols from /usr/lib/debug//usr/sbin/minidlnad.debug...
[New LWP 5874]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `/usr/sbin/minidlnad -P /run/minidlna/minidlna.pid -f /etc/minidlna.conf'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055629758572a in select_del (ev=0x556298c16820, flags=<optimized out>) at select.c:135
135     select.c: No such file or directory.
(gdb) bt
#0  0x000055629758572a in select_del (ev=0x556298c16820, flags=<optimized out>) at select.c:135
#1  0x000055629755d6cf in CloseSocket_upnphttp (h=h@entry=0x556298c16820) at upnphttp.c:126
#2  0x0000556297560188 in SendResp_dlnafile (h=h@entry=0x556298c16820, object=object@entry=0x7ffd80ef0fbc "2970.avi") at upnphttp.c:2121
#3  0x000055629756098d in ProcessHttpQuery_upnphttp (h=h@entry=0x556298c16820) at upnphttp.c:1015
#4  0x0000556297560da2 in Process_upnphttp (ev=<optimized out>) at upnphttp.c:1145
#5  0x0000556297585675 in select_process (tv=<optimized out>) at select.c:177
#6  0x000055629755bd10 in main (argc=<optimized out>, argv=<optimized out>) at minidlna.c:1286
(gdb) bt full
#0  0x000055629758572a in select_del (ev=0x556298c16820, flags=<optimized out>) at select.c:135
        ev0 = <optimized out>
        __PRETTY_FUNCTION__ = "select_del"
#1  0x000055629755d6cf in CloseSocket_upnphttp (h=h@entry=0x556298c16820) at upnphttp.c:126
No locals.
#2  0x0000556297560188 in SendResp_dlnafile (h=h@entry=0x556298c16820, object=object@entry=0x7ffd80ef0fbc "2970.avi") at upnphttp.c:2121
        header = "HTTP/1.1 206 OK\r\nConnection: close\r\nDate: Sun, 12 Feb 2023 15:10:26 GMT\r\nServer: 6.1.0-02431-g1d81821b3b8f DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.3.1\r\nEXT:\r\nrealTimeInfo.dlna.org: DLNA.ORG_TLAG=*\r\ntransferM"...
        str = {data = 0x7ffd80ef0b30 "HTTP/1.1 206 OK\r\nConnection: close\r\nDate: Sun, 12 Feb 2023 15:10:26 GMT\r\nServer: 6.1.0-02431-g1d81821b3b8f DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.3.1\r\nEXT:\r\nrealTimeInfo.dlna.org: DLNA.ORG_TLAG=*\r\ntransferM"..., off = 464, size = 1024}
        buf = "'\263\061\232bU\000\000\364O\000\000\000\000\000\000\360\n\357\200\375\177\000\000\236\204X\227bU\000\000p\f\357\200\375\177\000\000\030\f\370\037\322\177\000\000\001\200\255\373\060\000\000\000P\262\061\232\002\000\000\000\001\200\255\373bU\000\000'\263\061\232bU\000\000'\263\061\232bU\000\000'\263\061\232bU\000\000'\263\061\232bU\000\000)\263\061\232bU\000\000\033\003\062\232bU\000\000'\263\061\232bU\000"
        result = 0x7ffd80ef0af0
        rows = 943206960
        ret = <optimized out>
        total = <optimized out>
        offset = 3816192466
        size = <optimized out>
        id = 2970
        sendfh = 13
        dlna_flags = 24117248
        cflags = <optimized out>
        tmode = <optimized out>
        ctype = <optimized out>
        last_file = {id = 2970, client = ELGNetCastDevice, path = "/dane/media/xxxxx.avi", '\000' <repeats 3959 times>,
          mime = "video/x-msvideo", '\000' <repeats 16 times>, dlna = '\000' <repeats 95 times>}
        newpid = 0
#3  0x000055629756098d in ProcessHttpQuery_upnphttp (h=h@entry=0x556298c16820) at upnphttp.c:1015
        HttpCommand = "GET", '\000' <repeats 12 times>
        HttpUrl = "/MediaItems/2970.avi\000U\000\000`\374\f \322\177\000\000\000\000\000\000\000\000\000\000\220h\n\232bU\000\000\020\021\000\000\000\000\000\000\240\220\371\037\322\177\000\000P\262\061\232\000\000\000\000\331\000\000\000\000\000\000\000\251n\000\000\000\000\000\000\000\232\370Ơ\241\220\276Sun, 12 \000\232\370Ơ\241\220\276\002\000\000\000\000\000\000\000h\377\377\377\377\377\377\377\002\000\000\000\000\000\000\000\200\364\n\232bU\000\000\253Y\000\000\000\000\000\000\036\000\000\000\000\000\000\000b\a\000\000\000\000\000\000\217\267\371\037\322\177\000\000 h\301\230bU\000\000\000\021\357\200\375\177\000\000 h\301\230bU\000\000`\205"...
        HttpVer = 0x556298c1684c "HTTP/1.1"
        p = <optimized out>
        i = <optimized out>
#4  0x0000556297560da2 in Process_upnphttp (ev=<optimized out>) at upnphttp.c:1145
        new_req_buflen = <optimized out>
        endheaders = <optimized out>
        buf = "GET /MediaItems/2970.avi HTTP/1.1\r\nHost: 192.yyyy:8200\r\nUser-Agent: Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 WebAppManager\r\nCo"...
        h = 0x556298c16820
        n = <optimized out>
#5  0x0000556297585675 in select_process (tv=<optimized out>) at select.c:177
        ev = 0x556298c16820
        ready = <optimized out>
        i = 4
#6  0x000055629755bd10 in main (argc=<optimized out>, argv=<optimized out>) at minidlna.c:1286
        ret = <optimized out>
        i = <optimized out>
        shttpl = 7
        smonitor = 5
        e = <optimized out>
        next = <optimized out>
        tv = {tv_sec = 36, tv_usec = 826935}
        timeofday = {tv_sec = 1676214626, tv_usec = 78263}
        lastnotifytime = {tv_sec = 1676214477, tv_usec = 881459}
        lastupdatetime = 0
        lastdbtime = 1676214477
        last_changecnt = 0
        scanner_pid = 0
        ssdpev = {fd = 6, index = 1, rdwr = EVENT_READ, {process = 0x55629756a1c0 <ProcessSSDPRequest>}, data = 0x0}
        httpev = {fd = 7, index = 2, rdwr = EVENT_READ, {process = 0x556297559b60 <ProcessListen>}, data = 0x0}
        monev = {fd = 5, index = 0, rdwr = EVENT_READ, {process = 0x556297568a40 <ProcessMonitorEvent>}, data = 0x0}
        beacon_interval = 60 '<'
        sbeacon = 9
        tivo_bcast = {sin_family = 2, sin_port = 36360, sin_addr = {s_addr = 4294967295}, sin_zero = "\000\000\000\000\000\000\000"}
        lastbeacontime = <optimized out>
        beaconev = {fd = 9, index = 3, rdwr = EVENT_READ, {process = 0x556297576ae0 <ProcessTiVoBeacon>}, data = 0x0}

Issues with NFO and Episode Numbers

Hi there. I have an issue where MiniDLNA reads NFO files that I've created for KODI, but it ignores the episode number, thus it lists all TV-Shows episodes in alphabetical order rather than by episode number.

Is there a way I can force MiniDLNA to also read the episode number and display correctly?

Alternatively, and probably easier, can I force MiniDLNA to ignore NFO files?

How to fully remove minidlna from Mac?

Hi, i was try install minidlna on mac, but it's seem not seeing any files from my Videos Folders. So i want to remove to hide it from tv. because it will be installed on debian as media server .

What can i do with this sutiation?

Unhelpful error on absence of gettext

When gettext is not installed the build output (for me) is as follows:

scons: Reading SConscript files ...
Checking for pkg-config... (cached) yes
Checking for libavformat... (cached) yes
Checking for libavutil... (cached) yes
Checking for libavcodec... (cached) yes
Checking for sqlite3... (cached) yes
Checking for libexif... (cached) yes
Checking for id3tag... (cached) yes
Checking for flac... (cached) yes
Checking for ogg... (cached) yes
Checking for vorbis... (cached) yes
Checking for ogg... (cached) yes
Checking for C library pthread... (cached) yes
Checking for C library jpeg... (cached) yes
Checking for C header file sys/inotify.h... (cached) yes
Checking for C header file iconv.h... (cached) yes
Checking for C header file libintl.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
Compiling: po/da.po
sh: check-domain: not found
Installing: po/da.mo => /usr/share/locale/da/LC_MESSAGES/minidlna.mo
scons: *** [/usr/share/locale/da/LC_MESSAGES/minidlna.mo] po/da.mo: No such file or directory
scons: building terminated because of errors.

I think you want to check that WhereIs("msgfmt") in tools/gettext.py doesn't return None and provide a more helpful error if it does.

README lacks compilation information

The readme refers to an INSTALL file which doesn't seem to be included in this repo. That should be added to the repository if it's still around. Alternatively I jotted up my steps for installing prerequisites and then compiling and installing the package which are available for inclusion via a pull request, #10. I had trouble actually starting the server though, so my instructions are missing something, possibly a step listed in the notorious INSTALL file?

Embedded artwork for FLAC files

Embedded artwork in FLAC files breaks the whole import of the file ("unable to read metadata" or something like it). I guess there are two steps to this:

  1. Fix parsing of FLAC metadata so it skips sections it doesn't understand/support. The file should still import correctly but without the cover image
  2. Add feature so the code supports embedded artwork in the FLAC metadata.

sql_get_int_field: step failed: SQL logic error or missing database

Got the above error on a fresh install of Mint Ubuntu for Pi 2. I configured my .conf file, stopped, deleted files.db and then ran 'sudo minidlna -R'

pi@pi-desktop:$ uname -a
Linux pi-desktop 3.18.0-21-rpi2 #22-Ubuntu SMP PREEMPT Sat Apr 25 05:05:37 UTC 2015 armv7l armv7l armv7l GNU/Linux
pi@pi-desktop:
$ cat /var/log/minidlna.log
[2015/05/10 20:50:57] minidlna.c:1040: warn: Starting MiniDLNA version 1.1.4.
[2015/05/10 20:50:57] minidlna.c:364: warn: Creating new database at /var/cache/minidlna/files.db
[2015/05/10 20:50:57] minidlna.c:1079: warn: HTTP listening on port 8200
[2015/05/10 20:50:57] scanner.c:726: warn: Scanning /media/pi/storage
[2015/05/10 20:51:34] scanner.c:813: warn: Scanning /media/pi/storage finished (22 files)!
[2015/05/10 20:51:35] playlist.c:125: warn: Parsing playlists...
[2015/05/10 20:51:35] playlist.c:259: warn: Finished parsing playlists.
[2015/05/10 20:51:35] sql.c:117: warn: sql_get_int_field: step failed: SQL logic error or missing database
SELECT count(*) from OBJECTS where PARENT_ID = '2$8';
pi@pi-desktop:~$

How to submit new po?

Hello,
I want to submit Chinese po. Should I fork this repo first? And how to named the po, zh or cn?
Thanks.

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.