Coder Social home page Coder Social logo

julian-klode / dir2ogg Goto Github PK

View Code? Open in Web Editor NEW
15.0 5.0 6.0 134 KB

Official repository of dir2ogg

Home Page: https://jak-linux.org/projects/dir2ogg/

License: GNU General Public License v2.0

Python 83.69% Shell 2.00% Roff 14.31%
mp3 ogg ogg-vorbis mp4 flac m4a wma aac ape wavpack

dir2ogg's People

Contributors

eaneto avatar julian-klode avatar micove avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

dir2ogg's Issues

Use shutil.move rather than os.rename

Whe the current directory FS (disk/partition) where dir2ogg is called from differs from the destination directory FS (disk/partition) of final files, then dir2ogg will fail like:

File "/usr/bin/dir2ogg", line 398, in decode
os.rename(tempwav, self.songwav)
OSError: [Errno 18] Invalid cross-device link

The following patch prevents such failure:

diff -Naur fastoggenc-old/fastoggenc fastoggenc/fastoggenc
--- fastoggenc-old/fastoggenc 2017-04-15 15:29:34.400646642 -0600
+++ fastoggenc/fastoggenc 2017-04-15 15:30:28.471085075 -0600
@@ -39,6 +39,7 @@
import sys
import gettext
import os, os.path
+import shutil
import re
import multiprocessing
import threading
@@ -546,7 +547,7 @@
if self.decoder == 'mplayer':
# Move the file for mplayer (which uses tempwav), so it works
# for --preserve-wav.
- os.rename(tempwav, self.songwav)
+ shutil.move(tempwav, self.songwav)
if retcode != 0:
return (False, None)
else:

I imagine there's another way around the issue, and it's making sure the temporal files are generated in the final destination rather than current directory, but in the end using shutil.move is a good easy solution, :-) See:

http://pythoncentral.io/how-to-rename-move-a-file-in-python

Opus support

What are your thoughts on adding support for encoding to opus?

There's a fork of dir2ogg, dir2opus, that does this, but I think it'd be better integrated into this tool.

dir2ogg should not re-convert already converted files

Hi,

i tried to use dir2ogg to convert my FLAC library to OGG, so i can use my music on my phone more efficiently. My music library is quite large, so the process took a while and after my ssh connection was unfortunately closed, i needed to restart dir2ogg just to notice, it started to re-convert every file it already has converted.

I think this is wrong. I wanted to use dir2ogg as a cronjob to automatically convert all new FLAC files.

FLAC 24bit 96kHz

you need to add options to change the sample rate of the songs, who will want a 96kHz ogg?

python 3 migration

dir2ogg is written for python 2. As python 2 is soon to cease support, it should be migrated to python 3.
If installed as a python 3 sw, just executing dir2ogg one gets the following error:

File "/usr/bin/dir2ogg", line 145
print 'INFO: %s' % msg
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('INFO: %s' % msg)?

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.