Commit Graph

2473 Commits

Author SHA1 Message Date
Robbt 28d2b110c2 made basic sanity checks to only do back up mp3 mutagen import on files with mp3 extension 2018-12-27 18:38:17 -05:00
Robbt 26fad97915 modified the code to treat a file mutagen fails to load as a mp3 2018-12-27 17:50:33 -05:00
Robb f011a13ecb
Merge pull request #654 from radiorabe/chore/cleanup-and-2to3-pypo-main
Cleanup pypo/__main__.py
2018-12-23 11:46:38 -05:00
Robb 71d4da185a
Merge pull request #652 from radiorabe/chore/cleanup-analyzer-abc
Cleanup airtime_analyzer/analyzer.py
2018-12-23 11:42:15 -05:00
Lucas Bickel 36891c18c8 ♻️ (pypo) cleanup pypo/__main__.py
Clean up code and add python 3 support (with python 2 bc).
2018-12-23 12:06:26 +01:00
Lucas Bickel 201d3741d8 🔥 (analyzer) cleanup analyzer.py 2018-12-22 22:19:38 +01:00
Robbt 0b9c3396ea removed debug line that was causing failures for m4a 2018-12-19 16:27:31 -05:00
Robbt 9e78c110c5 made mutagen version 1.41 or above 2018-12-19 15:50:10 -05:00
Robbt 626e682aad changed celery podcast download to use mutagen for all supported files vs. mp3 only 2018-12-13 12:36:10 -05:00
Robbt a2573b52d2 fixed bad operator 2018-12-13 08:58:59 -05:00
Robbt f673d92edd modified bitrates to match new mutagen values 2018-12-13 08:53:52 -05:00
vagrant 2ee85f0546 made mp3 bitrate test a range vs. exact number because of variation in results from different mutagen versions 2018-12-04 00:35:24 +00:00
Robbt 6b0e6312af removed the version restriction on mutagen to take advantage of bug fixes 2018-11-28 07:47:54 -05:00
Robbt 8a6f992aa5 Increased podcast download timeout to 1800 seconds 2018-10-21 17:18:29 -04:00
Lucas Bickel f7ceeedb04 (Amazon S3) drop broken S3 support 2018-10-06 12:45:22 +02:00
Lucas Bickel da64166fa5 Fix call with deprecated arg 2018-07-06 12:12:39 +02:00
Robb 0b0cb77c29
Merge pull request #432 from radiorabe/fix/remove-dead-hack
Remove std_err_override
2018-05-24 14:10:12 -04:00
expert-geeks 539b03dd8c
Stop ShoutCAST rejecting title updates
When Libretime streams a webstream, the ID3 data is put into a single title field, leaving the artist field blank. When processing the ID3 data, Libretime concatenates the blank 'artist' field with the title, leaving '- title'. ShoutCAST rejects title updates that begin with punctuation for stylistic reasons (thanks guys) and so effectively ignores all ID3 data coming with the stream, falling back to the 'Station off-air' message. This PR uses the title field alone if the artist field is blank, but both when the artist data is available e.g. when streaming an MP3.
2018-03-04 15:04:31 +00:00
Lucas Bickel ff6f497fbb Remove std_err_override
This hasn't been used in many moons.
2018-02-03 12:45:34 +01:00
Kyle Robertze c16d7c2a1d remove media-monitor
airtime-media-monitor conflicts with airtime-analyzer, which is what
is now used to monitor the LibreTime application

https://github.com/LibreTime/libretime-debian-packaging/issues/2#issuecomment-359987457
2018-01-24 09:20:51 +02:00
Lucas Bickel bf5cfbcf56 gracefully handle missing config option 2017-10-15 14:45:22 +02:00
Lucas Bickel ace7e493f4 Fix port and protocol default values
Turns our bare ConfigObjects don't to default passing very automatically.
2017-10-15 13:46:40 +02:00
Lucas Bickel 4287ac1c70 Revert pypofile try block move
Config file getting is allowed to fail. I didn't realize that it
would not just use the default instead of excepting and getting
caught. Sorry for that.
2017-10-15 13:14:40 +02:00
Robb 38fe253438 Merge pull request #329 from radiorabe/fix/pypo-update-track-time
Pypo track updating fix
2017-10-14 10:18:11 -04:00
Lucas Bickel 6e35cfb44b Fix whitespace and move config getting into try 2017-10-08 16:15:08 +02:00
Lucas Bickel 1add49efdf Merge pull request #327 from Robbt/robbt-fix/podcast_download_decode_to_avoid_corruption
Fix podcast corruption by adding decode = true to the raw request object for the celery task
2017-10-08 14:50:17 +02:00
Robb Ebright 5150f3add5 Adding decode = true to the raw request object fixes issues with certain podcasts and corruption 2017-10-07 18:48:39 -04:00
Xabi Spacebiker 5160fc64d7 Update pypofile.py
Last update
2017-10-03 03:37:06 +02:00
Xabi Spacebiker 216294428a Update pypofile.py 2017-10-03 01:28:01 +02:00
Xabi Spacebiker cfb99fa926 Update pypofile.py
1st- Changes the file permissions of cache files from 444 to 644
2nd- Put the host variables into a single array, this way we can pass the full variable to the report_file_size_and_md5_to_airtime function.
2017-10-02 23:42:11 +02:00
Xabi Spacebiker 2104b53761 Update pypofile.py
Adding user write permission in cached file
2017-09-28 11:12:57 +02:00
Lucas Bickel 586314052f Better error message when parsing WAVE file 2017-09-20 19:13:15 +02:00
Robb bd845a016d Merge pull request #253 from radiorabe/feature/refactor-config-structure
Simplify configuration file structure
2017-08-05 20:47:28 -04:00
Robb Ebright 314654dfe4 Enable logging for analyzer and pypo 2017-08-05 17:56:23 -04:00
Lucas Bickel fa2018a2c5 Simplify configuration file structure
This removes most of the legacy upstream config madness by not using
weird config files spread all over the place.

This isn't the solution to other config reading fragility issues, but
it does move the whole config back to the central airtime.conf file.
2017-07-21 13:15:28 +02:00
Lucas Bickel 0a556adbfa Use proper protocol in URL if port is set to 443
This adds TLS support to pypo when downloading files from the REST
API. I previously fixed some similar issues in the api_client and
wasn't aware that pypo isn't using it for every URL..
2017-07-21 12:27:34 +02:00
Robb 6e2cb2b2a8 Merge pull request #241 from radiorabe/feature/update-install
Update installer with systemd detecting code
2017-07-10 23:28:23 -04:00
Robb 3b2a9451eb Merge pull request #169 from radiorabe/feature/use-official-magic
Use file-magic instead of python-magic
2017-04-28 19:56:38 -04:00
Bill Burton 320856516f Merge remote-tracking branch 'upstream/master' into install-auto-detect-distro-init 2017-04-28 11:38:12 -04:00
Bill Burton 3179651dec Installer auto-detects distro, portable system init
The theme of this commit is to make the install process more
resiliant to differences in distros by testing for specific
features or versions of executables rather than making as many
assumptions just on the distro and release.

* Distro and Release detection (install, Vagrantfile)
  - Added detection logic for distro and release based on
    /etc/os-release which is available on all potential supported
    distros. The --distribution and --release options can be used
    to override detection.
  - Added distro and release checks to ensure values specified are
    for a supported release.
  - Changed some distro checks to use booleans, e.g.
    if $is_centos_7; then ...
  - Added a simple check so if --distribution is specified, it will
    ensure it's at least sane, e.g. centos on debian or debian on
    centos will be caught.
  - In Vagrantfile, removed --distribution and --release options for
    all distro and release combinations.

* Portable Init System Detection and Management (install, centos.sh)
  - Added detection logic for init system type - systemd, Upstart or
    System V in the function systemInitDetect().
  - Added portable init system install in the function
    systemInitInstall() which depends on systemInitDetect(). After
    installing files, enables and starts service.
  - Added portable init system commands in the function
    systemInitCommand() for start, stop, reload, restart and status.
  - Python services don't support systemd but unconditionally install
    scripts for both Upstart and System V. Disabled by passing
    --no-init-script to setup.py for each service.
  - When upgrading, remove all old system init files in /etc/init,
    /etc/init.d, /etc/default and /etc/systemd/system.
  - In centos.sh, removed install of airtime systemd service files
    as it's now handled by install.
  - Created an Upstart .conf for airtime-celery
  - In systemd file for airtime-celery, changed absolute path to
    /usr/local/bin/celery and for centos, the install symlinks
    celery to /usr/local/bin.

* External Dependencies Install (install)
  - For external dependencies, only attempt to install for Debian-
    based distros with apt-get. For centos, a warning is displayed.
  - For systems with apt-get, detect version and if 1.1 or greater,
    use new force options, otherwise use --force-yes option.

* Configuring Apache (install)
  - For Apache, check for centos and use httpd for binary and
    service, otherwise use apache2ctl and apache2.
  - Detect Apache version 2 or better in a more reliable manner.
  - Detect Apache root folder and conf file name by running
    apache2ctl -V or httpd -V as appropriate.
  - Various checks for centos as it doesn't support the Debian
    Apache utilities a2ensite/a2dissite, a2enmod/a2dismod, etc.

* Installing Airtime Services (install)
  - Detect Python version. If less than 2.7.9, install OpenSSL
    support.
  - Prevent installing init files by passing --no-init-script to
    setup.py for each service.
  - Use systemInitInstall to install, enable and start each service
    after setup.py has run.
  - Removed filtering for WEB_USER for files in
    /etc/init/airtime*.template as that is handled in the
    systemInitInstall() function.

* Configuring PHP in Apache (install)
  - Detect PHP conf folder by checking a list of locations rather
    than making assumptions based on the distro and release.

* Configuring PostgreSQL (install)
  - Detects if the airtime user has already been created. If not,
    then creates the user.

* Installing Locales (install)
  - Minor changes to check for centos and prevent from running.
2017-04-28 11:00:50 -04:00
Lucas Bickel 65a4961aac Merge pull request #187 from Kirill-Kad/patch-1
Correction lines 399 and 400.  ls_script.liq
2017-04-25 13:09:58 +02:00
Lucas Bickel 122166216a Merge pull request #157 from Lapotor/Ubuntu-16.04-Update
Ubuntu 16.04 installer update
2017-04-20 15:21:56 +02:00
Lapotor 0766b91cde Added remind to reload systemctl for Xenail 2017-04-19 20:36:48 +02:00
Lucas Bickel 9ce611130c Use file-magic instead of python-magic
This gets the mime type using file-magic in a most minimal way. Since the python bindings have been available as a distro package for quite a while it is written in a way so it should also run on pre pypi installs of file-magic. This means not being able to use nice things like magic.detect_from_filename due to the fact that they where added rather recently (with recently being 2 years ago).

As the mime type is only used to check for wav files that mutagen can't handle it only reads the mime type and ignores the charset and other attributes that magic can find.

Due to the fact that file-magic is not properly unicode safe I'm checking the file based on it's first 2048 bytes as per <http://stackoverflow.com/questions/34836792/python-magic-cant-identify-unicode-filename#comment57418632_34838355>. This is not an issue since wav files need to start with a wav header by definition anyway.

I tested this sucessfully on both CentOS and Debian with files containing Unicode in their names.
2017-04-18 09:49:09 +02:00
Robb ebd7c1d2a3 Merge pull request #163 from radiorabe/feature/python-debug-flag-for-140
Problem: airtime-liquidsoap --debug only works for liquidsoap
2017-04-17 16:36:07 -04:00
Lucas Bickel 8253a070f4 Update name in ref_off_air_meta in Liquidsoap 2017-04-16 01:23:40 +02:00
Lucas Bickel 007ff5561c Pass debug flag to python logger as well 2017-04-15 23:27:04 +02:00
Lucas Bickel f1d6fdea39 Merge pull request #161 from Robbt/fix/celery-worker-crash
Fix/celery worker crash
2017-04-14 09:25:58 +02:00
Robb Ebright 2d7882872b use celery 3.0 and compatible kombo 2017-04-13 23:11:59 -04:00
Robb Ebright c7131e0936 set celery version 3 2017-04-13 21:58:49 -04:00