Credits
Major portions of the code were ported from the following repository: https://github.com/NivinCNC/CNCVerse-Cloud-Stream-Extension/tree/master/CricifyProvider Thanks to NivinCNC for their work on the original Cricfy provider extension for Cloudstream. This Kodi plugin is based on their implementation, adapted to work within the Kodi ecosystem.Please refer to the original Cloudstream extension project for additional context and reference implementations.
Development setup
To contribute to the project, you’ll need to set up your development environment.Prerequisites
- Python 3.8 or higher
- Kodi installation (for testing)
- Git for version control
- Text editor or IDE (VS Code, PyCharm, etc.)
Clone the repository
Install dependencies
The plugin uses several Python libraries:requests- HTTP requestspycryptodomex- AES encryption/decryption- Kodi addon dependencies (xbmc, xbmcgui, xbmcplugin, xbmcaddon, xbmcvfs)
Kodi addon dependencies are only available within the Kodi environment. For local development, you may want to create stub modules for type checking and linting.
Testing in Kodi
To test your changes:- Create a symbolic link from your development directory to Kodi’s addon directory:
- Enable debug logging in Kodi (Settings → System → Logging)
- Launch the addon and check the Kodi log for errors
Code structure guidelines
Follow these guidelines when contributing code to maintain consistency and quality.Module organization
The plugin follows a modular structure:- main.py - Entry point and routing logic
- service.py - Background service for initialization
- lib/ - Core business logic modules
- config.py - Configuration and cache setup
- providers.py - Provider and channel management
- m3u_parser.py - M3U playlist parsing
- crypto_utils.py - Encryption/decryption utilities
- remote_config.py - Firebase Remote Config integration
- req.py - HTTP request utilities
- logger.py - Logging utilities
Coding style
- Use snake_case for function and variable names
- Use PascalCase for class names
- Add docstrings to functions explaining their purpose
- Keep functions focused on a single responsibility
- Use type hints where appropriate (Python 3.8+ syntax)
Error handling
- Always handle exceptions gracefully
- Use the logger module for error reporting
- Provide user-friendly error messages via Kodi dialogs when appropriate
Caching best practices
- Use descriptive cache keys
- Set appropriate TTL values based on data volatility
- Hash long or variable-length keys using
_hash_key() - Always validate cached data before using it
How to submit pull requests
Follow these steps to submit your contribution:1. Fork and create a branch
Fork the repository on GitHub and create a new branch for your changes:feature/add-epg-supportfix/channel-parsing-errordocs/improve-installation-guide
2. Make your changes
- Write clear, focused commits
- Follow the code structure guidelines above
- Test your changes thoroughly in Kodi
- Update documentation if needed
3. Commit your changes
Write clear commit messages:- “Fix channel parsing when tvg-logo is missing”
- “Add retry logic for failed provider requests”
- “Update installation instructions for Matrix”
4. Push and create a pull request
Push your branch to your fork:- Clear description of what changes you made
- Explanation of why the changes are needed
- Any testing you performed
- Screenshots or logs if applicable
5. Respond to feedback
Be responsive to code review comments and make requested changes promptly.Pull requests should focus on a single feature or fix. If you have multiple unrelated changes, submit separate pull requests.
Testing checklist
Before submitting a pull request, verify:- Plugin installs successfully in Kodi
- Providers list loads correctly
- Channels display for multiple providers
- Video playback works with at least one stream
- DRM content plays (if applicable)
- No errors in Kodi log during normal operation
- Cache invalidation works as expected
- Changes don’t break existing functionality
Reporting issues
If you find a bug or have a feature request:- Check if the issue already exists on GitHub
- Create a new issue with:
- Clear description of the problem
- Steps to reproduce
- Kodi version and platform
- Relevant log excerpts (enable debug logging)
- Screenshots if applicable
License
By contributing to this project, you agree that your contributions will be licensed under the GNU General Public License version 3.0 or later.
You can use, study, share and modify the code at your will. Contributions can be redistributed and/or modified under the terms of the GNU General Public License version 3 or later published by the Free Software Foundation.
Repository
The project is hosted on GitHub: https://github.com/itsyourap/cricfy-kodi-pluginQuestions?
If you have questions about contributing, feel free to:- Open a discussion on GitHub
- Check existing issues and pull requests for examples
- Review the source code documentation
