{"id":15659238,"url":"https://github.com/lowlighter/rakun","last_synced_at":"2025-08-10T07:20:11.108Z","repository":{"id":40697007,"uuid":"264298706","full_name":"lowlighter/rakun","owner":"lowlighter","description":"🦝 A parser to extract metadata from anime torrent filename, like source, codecs, resolution, series, audio, etc.","archived":false,"fork":false,"pushed_at":"2023-01-27T03:53:05.000Z","size":613,"stargazers_count":22,"open_issues_count":6,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T04:14:26.421Z","etag":null,"topics":["anime-torrents","parser","torrent","torrent-management"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lowlighter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2020-05-15T21:05:14.000Z","updated_at":"2024-11-04T20:34:55.000Z","dependencies_parsed_at":"2023-02-15T05:01:14.829Z","dependency_job_id":null,"html_url":"https://github.com/lowlighter/rakun","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowlighter%2Frakun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowlighter%2Frakun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowlighter%2Frakun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lowlighter%2Frakun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lowlighter","download_url":"https://codeload.github.com/lowlighter/rakun/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252436586,"owners_count":21747472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anime-torrents","parser","torrent","torrent-management"],"created_at":"2024-10-03T13:15:52.885Z","updated_at":"2025-05-05T04:14:32.486Z","avatar_url":"https://github.com/lowlighter.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🦝 Rakun - An Anime torrent name parser\n\n![Onee-chan](https://github.com/lowlighter/rakun/workflows/Onee-chan/badge.svg) ![Tests passed](https://badges.lecoq.io/rakun.tests) ![Coverage](https://img.shields.io/endpoint?url=https%3A%2F%2Fbadges.lecoq.io%2Frakun%2Fcoverage) ![Code quality](https://img.shields.io/codacy/grade/114dbe0608b14b6a8e92163a6dffc9b4/master?labelColor=2F3338\u0026link=https://app.codacy.com/manual/simon.lecoq/rakun) ![Version](https://img.shields.io/github/package-json/v/lowlighter/rakun?labelColor=2F3338) ![License](https://img.shields.io/github/license/lowlighter/rakun?labelColor=2F3338)\n\nA parser to extract informations and metadata from anime torrents filename.\nWith this, it'll be easier to script anime torrents related stuff !\n\n\n## 💻 Usage\n\n### 🦝 [Website](https://rakun.app)\n\nIf you want to use Rakun online, you can visit the website by [@Wamy-Dev](https://github.com/Wamy-Dev/Rakun.app) at [rakun.app](https://rakun.app).\n\n\n### 📦 Installation\n\nYou can either use default npm registry (`https://registry.npmjs.org`) or the GitHub package registry (`https://npm.pkg.github.com`).\n```bash\nnpm install @lowlighter/rakun --save\n```\n\n### ⏪ With the following code...\n\n```typescript\nimport rakun from \"rakun\"\nconsole.log(rakun.parse(\"[Team246] Ghost in the shell Stand alone complex S01 E10-E15 [BDREMUX 1080P MULTi DTSHDMA 5.1][VOSTFR]\"))\n```\n\n### ⏩ You'll get the following output :\n\n```typescript\n{\n  filename:\"[Team246] Ghost in the shell Stand alone complex S01 E10-E15 [BDREMUX 1080P MULTi DTSHDMA 5.1][VOSTFR]\",\n  subber:\"Team246\",\n  name:\"Ghost in the shell Stand alone complex\",\n  season:\"1\",\n  episode:\"10-15\",\n  resolution:\"1080p\",\n  audio:\"multi vo\",\n  subtitles:\"fr\",\n  source:\"bluray\",\n  codecs:\"audio_5_1 dts_hdma\",\n  meta:\"remux\",\n}\n```\n\n### 📊 What's rakun performances ?\n\nWe try to gather a lot of different torrents name format from all over the net to make **rakun** more efficient and reliable.\nYou can check [tests cases](https://github.com/lowlighter/rakun/tree/master/tests/cases) to see what kind of formatting is currently supported.\n\nBelow is an excerpt of tests cases which may help you to check **rakun**'s capabilities :\n```text\n- [Leopard-Raws] Shingeki no Kyojin Season 3 Part.2 - 09 END RAW (NHKG 1280x720 x264 AAC).mp4\n- [Team246] Ghost in the shell Stand alone complex S01 E10-E15 [BDREMUX 1080P MULTi DTSHDMA 5.1][VOSTFR]\n- [U3-Web] PSYCHO-PASS 3 - FIRST INSPECTOR (2020) [Movie][AMZN WEB-DL(v) 1080p AVC AAC DDP SRT][Multi-Subs] (PSYCHO-PASS サイコパス / 心靈判官 / 心理測量者)\n- [Kaerizaki-Fansub]_One-Piece_Stampede_Film_14_[VERSION-LIGHT][VOSTFR][BLU-RAY][FHD_1920x1080].mp4\n- Serial Experiments Lain (1998) 1080p.H264.Ac3.Ita.Flac.Jap.Eng.Sub.Ita.Eng [v2] [21GB] [stress]\n- [T.H.X\u0026A.I.R.nesSub][Shinsekai_Yori][BDRIP][Vol.1-9全][1920x1080_10bpp][AVC_FLAC][MKV]\n- [BDRip1080p.x264.AC3.ITA.ENG.JAP.].Fullmetal.Alchemist.Brotherhood + OAV Bluray RIP\n- [AnimeRG] Spirited Away (2001) (Sen to Chihiro no Kamikakushi) [720p BD 10bit] [Dual Audio] [Multi-Language Subtitles] [JRR] [Studio Ghibli].mkv\n- Death Note 1-37 [480p] [EN SUB]\n- Dragon.Ball.Z.Movie.14.Battle.of.Gods.2013.EXTENDED.DUAL.AUDiO.SUB.PL.1080p.BluRay.REMUX.AVC.TrueHD.5.1-SeBoLeX\n- [Erai-raws] Berserk 2017 - 12 [v2][END][720p][Multiple Subtitle][10A073DC].mkv\n- [BDMV] Made in Abyss / メイドインアビス [BD-BOX I+II][JP]\n- Naruto.SD.Rock.Lee.no.Seishun.Full-Power.Ninden.S01.FRENCH.DVDRiP.x264-Kazelle\n- Evangelion 1.11 You Are (Not) Alone 2007 Multi 1080p Blu-ray Remux AVC DTS-HD MA 6.1 VFF 5.1 H264 [Team246]\n```\n\n### 📑 Extracted informations\n\nBelow is the descriptor of the possible extreacted torrent informations.\nMultiple values properties (codecs, audio, subtitles, etc.) are sorted to keep consistancy.\n\n```typescript\n/** Torrent informations. */\n  interface TorrentInfos {\n    //Original filename\n      readonly filename:string\n    //Cleaned name\n      readonly name:string\n    //Hash\n      readonly hash?:string\n    //File extension\n      readonly extension?:string\n    //Resolution\n      readonly resolution?:string\n    //Source (Bluray, DVD, etc.)\n      readonly source?:string\n    //Codecs\n      readonly codecs?:string\n    //Audio language\n      readonly audio?:string\n    //Subtitles language\n      readonly subtitles?:string\n    //Subber group (or translation group)\n      readonly subber?:string\n    //Website of subber\n      readonly website?:string\n    //Content producer/distributor\n      readonly distributor?:string\n    //Torrent other metadata (remux, repack, etc.)\n      readonly meta?:string\n    //Movie\n      readonly movie?:string\n    //Season\n      readonly season?:string\n    //Part\n      readonly part?:string\n    //Episode (or episode range)\n      readonly episode?:string\n  }\n```\n\n## 🔧 Under the hood\n\n### 🧬 ATNP's logic\n\nParsing follows the following workflow :\n* An input `filename` is given, with possible parser `options`\n* Pre-processors are executed\n* Main processor iterates through the [collection of regexs](https://github.com/lowlighter/rakun/tree/master/src/regexs) to extract informations from `filename`\n  * At each iteration, extracted informations can be either removed from `filename` through [cleaners](https://github.com/lowlighter/rakun/blob/master/src/regexs/cleaners.ts) are applied to remove remnants, or keept for next iteration for closely related informations (like season, parts and episode)\n* Post-processors are executed\n* The remaining part of `filename` is considered as the cleaned title\n* Extracted informations are returned\n\n#### 📰 Additional informations\n\nRegexs are ordered to match first what can be accurately extracted and removed early (like hash, extension, website, etc.) to ease the remaining extraction.\n\nExcept for cleaners and specials regexs, they should have named capture groups. (if capture group are needed). It allows easier understanding of regexs, but it is also the way that the parser register data. \n\nThe main processor is a list of descriptors with the following properties :\n```typescript\n{\n  key?:string,                      // Property to set (e.g. audio, episode, meta, etc..)\n  collection?:RegExp[],             // Regex collection to use\n  get?:\"key\"|\"value\",               // If \"key\", will return capture group's name ; if \"value\", will return capture group's value\n  mode?:\"append\"|\"replace\"|\"skip\",  // If \"append\", add value (or create) to property ; if \"replace\", replace property ; if \"skip\", skip if property already defined\n  clean?:boolean,                   // If true, cleaners will be applied at the end of the iteration\n  cleaners?:RegExp[]                // Additional cleaners to apply\n}\n```\n\nWhile the aim is to reach 100% accuracy, note that this objective is nearly impossible since there are too much outliers in naming conventions across various websites.\n\n### 🏅 Code quality\n\nTo ensure a quality library, code is required to pass **Onee-chan**'s judgement and fulfill a parsing accuracy of at least **85%** of defined [test cases](https://github.com/lowlighter/rakun/tree/master/tests/cases).\n\nPull requests may not be merged if they do not reach this standard, unless they are adding revelant tests which may reveal missed matches in current builds. Although edges cases should be integrated to challenge **rakun**, simpler cases should also be added to not biases **Onee-chan**'s evaluation.\n\n### 💪 Contributing\n\nWant to contribute ? Sugoï ! Here what you can help with :\n\n#### Open a pull request to\n  - Add new features for [rakun](https://github.com/lowlighter/rakun/tree/master/src)\n  - Complete [regexs collection](https://github.com/lowlighter/rakun/tree/master/src/regexs)\n  - Define new [tests cases](https://github.com/lowlighter/rakun/tree/master/tests/cases)\n\n#### Open an issue to\n  - Reports bugs or unsupported format that should be\n  - Ask help\n\n### 🧾 License\n\n**rakun** is licensed under the [MIT License](https://github.com/lowlighter/rakun/blob/master/LICENSE).\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flowlighter%2Frakun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flowlighter%2Frakun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flowlighter%2Frakun/lists"}