Code Monkey home page Code Monkey logo

Comments (1)

CatKasha avatar CatKasha commented on May 29, 2024

its easy to read what size ID3 tag have, but ID3 tag can be up to 256mb and filetype.py (current v1.2.0) only reads first 8kb and idk if filetype.py can read more or seek though file

only solution that i can make is to move FLAC matcher above MP3 and check if ID3 tag smaller than readed buf, then check FLAC header after ID3 tag, if not then return None

same check should be apply to MP3 too tbh

here is code how to skip ID3 tag

id3_flags = bin(buf[5])[2:].zfill(8)
footer_present = bool(int(id3_flags[3]))
id3_tag_size = ""
for i in buf[6:10]:
	id3_tag_size += bin(i)[2:].zfill(7)
id3_tag_size = int(id3_tag_size, 2) + 10
if (footer_present):
	id3_tag_size += 10

file.seek(id3_tag_size, 0)

from filetype.py.

Related Issues (20)

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.