hzqtc / fmd Goto Github PK
View Code? Open in Web Editor NEWDouban FM Daemon (inspired by Music Player Daemon)
Home Page: http://hzqtc.github.io/fmd/
Douban FM Daemon (inspired by Music Player Daemon)
Home Page: http://hzqtc.github.io/fmd/
% make release ~opensources/douban/fmd
gcc -Wall -O2 -c app.c
In file included from app.c:2:
player.h:4:20: error: mpg123.h: No such file or directory
player.h:5:19: error: ao/ao.h: No such file or directory
In file included from app.c:2:
player.h:30: error: expected specifier-qualifier-list before ‘mpg123_handle’
app.c: In function ‘get_fm_info’:
app.c:36: error: ‘fm_player_t’ has no member named ‘status’
app.c:40: error: ‘fm_player_t’ has no member named ‘status’
app.c: In function ‘app_client_handler’:
app.c:67: error: ‘fm_player_t’ has no member named ‘status’
app.c:82: error: ‘fm_player_t’ has no member named ‘status’
app.c:125: warning: implicit declaration of function ‘atoi’
app.c: In function ‘daemonize’:
app.c:148: warning: implicit declaration of function ‘exit’
app.c:148: warning: incompatible implicit declaration of built-in function ‘exit’
app.c:155: warning: incompatible implicit declaration of built-in function ‘exit’
app.c:170: warning: incompatible implicit declaration of built-in function ‘exit’
app.c: In function ‘main’:
app.c:252: error: ‘MPG123_ENC_SIGNED_16’ undeclared (first use in this function)
app.c:252: error: (Each undeclared identifier is reported only once
app.c:252: error: for each function it appears in.)
make: *** [app.o] Error 1
Hi,
The douban.fm server ban the request without user-agent
. The default curl request is not include User-agent field, it would return a HTTP 403 error.
<html>
<head><title>403 Forbidden</title></head>
<body bgcolor="white">
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>
so, to fix this bug just need to add curl_easy_setopt(pl->curl, CURLOPT_USERAGENT, "curl/7.30.0");
to the source code.
I have found another problem. When I started fmd and hit "fmc toggle", the fmd was killed. And it's ok when I hit "fmc play" and then "fmc toggle". I have found the code below:
void fm_player_toggle(fm_player_t *pl)
{
if (pl->status == FM_PLAYER_PLAY)
fm_player_pause(pl);
else
fm_player_play(pl);
}
I think maybe it's where the problem occured.
能否加上换台的功能?还有红心频率。btw,我准备移植到openwrt上。
The version of libmpg123 in Ubuntu 12.04 is 1.12.1, there is no 'mgp123_encsize' function in the mpg123.h, so I have to install the newest libmpg from source.
btw, I'm about to add a new command 'chvol' to control the volume.
It's a great job! But it's sometimes not stable. Sometimes I run fmd but I can't find the process when I look for "ps -e".
Just let you know that your project looks really interesting. Is there any plan to implement Pro features such as high-quality music and downloads?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.