Skip to content

Commit

Permalink
updated documentations
Browse files Browse the repository at this point in the history
so that people can better understand this code.
  • Loading branch information
Ghalbeyou committed Apr 11, 2023
1 parent 74f2450 commit 20b0b1e
Show file tree
Hide file tree
Showing 14 changed files with 211 additions and 243 deletions.
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/aparat-streamer.iml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/discord.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

30 changes: 16 additions & 14 deletions CLI.Streamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,28 @@
import argparse
import colorama

# Define command line arguments using argparse
parser = argparse.ArgumentParser(description="Aparat Streamer CLI for J-UI",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("-k", "--key", help="Stream key")
parser.add_argument("-l", "--location", help="Stream vid location")
parser.add_argument("-k", "--key", help="Stream key") # Stream key argument
parser.add_argument("-l", "--location", help="Stream vid location") # Stream video location argument
option = parser.parse_args()
print(option)
VIDEO_SOURCE = option.location
VIDOE_STREAM_KEY = option.key

VIDEO_SOURCE = option.location # Set video source from command line argument
VIDOE_STREAM_KEY = option.key # Set stream key from command line argument

# Loads config
async def main():
try:

print(colorama.Fore.GREEN + "Streamer by " + colorama.Style.DIM + "GHALBEYOU\n" + colorama.Style.RESET_ALL + colorama.Fore.GREEN + "GitHub.com/ghalbeyou\n\n Loading ...")
await sleep(5)
os.system("cls")

# Open stream
stream = CamGear(source=VIDEO_SOURCE, logging=True).start()

# define required FFmpeg optimizing parameters for your writer
# Define required FFmpeg optimizing parameters for your writer
# [NOTE]: Added VIDEO_SOURCE as audio-source
# [WARNING]: VIDEO_SOURCE must contain audio
output_params = {
Expand All @@ -45,7 +48,7 @@ async def main():

# [WARNING]: Change your YouTube-Live Stream Key here:

# Define writer with defined parameters and
# Define writer with defined parameters and stream key
writer = WriteGear(
output_filename="rtmp://rtmp.cdn.asset.aparat.com:443/event/{}".format(VIDOE_STREAM_KEY),
logging=True,
Expand All @@ -55,26 +58,25 @@ async def main():
# loop over
while True:

# read frames from stream
# Read frames from stream
frame = stream.read()

# check for frame if Nonetype
# Check for frame if NoneType
if frame is None:
break

# {do something with the frame here}

# write frame to writer
# Write frame to writer
writer.write(frame)

# safely close video stream
# Safely close video stream
stream.stop()

# safely close writer
# Safely close writer
writer.close()
except Exception:
print("There was as error")


if __name__ == '__main__':
asyncio.run(main=main())
asyncio.run(main=main())
142 changes: 33 additions & 109 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,128 +1,52 @@
# Contributor Covenant Code of Conduct
# Code of Conduct

## Our Pledge
## Introduction

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
As contributors and maintainers of the Aparat Streamer project, we are committed to creating a safe and inclusive environment for everyone. This Code of Conduct outlines our expectations for all those who participate in our project, as well as the consequences for unacceptable behavior.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
We value and embrace diversity in all forms, including but not limited to race, color, ethnicity, nationality, religion, sexual orientation, gender identity, age, disability, and experience level. We believe that a diverse and inclusive community fosters creativity, innovation, and mutual respect, and we strive to provide such an environment for everyone involved in our project.

## Our Standards
## Expected Behavior

Examples of behavior that contributes to a positive environment for our
community include:
All contributors and maintainers are expected to:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
- Be respectful and inclusive in all interactions, including but not limited to discussions, comments, and contributions.
- Use inclusive language and avoid offensive, discriminatory, derogatory, or inappropriate language or behavior.
- Respect and appreciate the opinions, ideas, and experiences of others, even if they differ from your own.
- Be patient and understanding, especially when providing feedback or addressing conflicts.
- Be open to constructive criticism and feedback, and strive to learn and grow from it.
- Follow the project's guidelines, code of conduct, and contribution guidelines at all times.

Examples of unacceptable behavior include:
## Unacceptable Behavior

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
Unacceptable behavior includes, but is not limited to:

## Enforcement Responsibilities
- Harassment, discrimination, or any form of offensive, derogatory, or inappropriate language or behavior based on race, color, ethnicity, nationality, religion, sexual orientation, gender identity, age, disability, or any other protected characteristic.
- Personal attacks, insults, or derogatory comments towards others.
- Intimidation, bullying, or any behavior that creates an uncomfortable or hostile environment.
- Posting or sharing of explicit, offensive, or inappropriate content.
- Violating any applicable laws or regulations.
- Any behavior that is harmful to the project or its community.

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
## Consequences of Unacceptable Behavior

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
Unacceptable behavior will not be tolerated by the Aparat Streamer project. Consequences of unacceptable behavior may include, but are not limited to:

## Scope
- Warning or reprimand from the project maintainers.
- Temporary or permanent ban from contributing to the project.
- Removal of comments, contributions, or other content deemed inappropriate.
- Reporting of the behavior to appropriate authorities, if necessary.

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
## Reporting and Enforcement

## Enforcement
If you witness or experience any behavior that violates this Code of Conduct, or if you have any concerns or questions, please report it to the project maintainers immediately. You can report the behavior by contacting us through the channels provided in the project's documentation or by emailing us at [[email protected]](mailto:[email protected]).

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
email.
All complaints will be reviewed and investigated promptly and fairly.
All reports will be reviewed in a timely and confidential manner, and appropriate actions will be taken by the project maintainers, which may include enforcement measures as outlined in the "Consequences of Unacceptable Behavior" section.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Acknowledgements

## Enforcement Guidelines
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, and is modified to suit the needs of the Aparat Streamer project.

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
## License

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
This Code of Conduct is licensed under the [GNU GENERAL PUBLIC LICENSE](LICENSE).
57 changes: 42 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
# Contributing rules
- DO NOT ADD ANY NEW CONTRIBUTING IF THERE IS NO COMMENT FOR WHAT ARE YOU DOING
- EDITING CONFIG.JSON FILE IS NOT ALLOWED
- IN THE MAIN.PY, EDITING MODULES IS NOT ALLOWED
- ONLY FIXING BUGS OR ADDING NEW FEATURES ALLOWED
- NO COPYING CURRENT CODE

## How to contribute?
There is a simple step to start contributing.
1. Fork this repo
2. Create new branch
3. Add changes to new branch
4. go to pull requests page on this repo
5. Hit compare and create your pull request
6. Wait until a moderator merge your pull request
# Contributing to the Aparat Streamer Project

Thank you for your interest in contributing to the Aparat Streamer project! We welcome contributions from the community to help improve our project and make it even better. Before you start contributing, please take a moment to review this document to ensure a smooth and collaborative contribution process.

## Code of Conduct

Please review and adhere to our [Code of Conduct](./CODE_OF_CONDUCT.md) at all times when participating in the project. We expect respectful and inclusive behavior from all contributors.

## Ways to Contribute

There are several ways you can contribute to the Aparat Streamer project:

- Reporting Bugs: If you encounter any bugs or issues while using the project, please report them by opening an issue in our issue tracker. Be sure to provide as much detail as possible, including steps to reproduce the issue and any relevant code or logs.
- Enhancements and New Features: If you have ideas for new features or improvements to existing functionality, feel free to open an issue to discuss your ideas with the community.
- Documentation: Contributions to improve the project's documentation, including fixing typos, clarifying explanations, or adding new content, are highly appreciated.
- Code Contributions: If you're a developer, you can contribute to the project by submitting code changes. Please follow the guidelines below when submitting your code.

## Submitting Code Changes

To contribute code changes to the Aparat Streamer project, please follow these steps:

1. Fork the repository to your GitHub account.
2. Create a new branch from the `main` branch with a descriptive name for your changes.
3. Make your changes in your branch, following the project's coding conventions, code style, and documentation guidelines.
4. Test your changes thoroughly to ensure they work as expected.
5. Update the documentation, including any relevant README files, if necessary.
6. Commit your changes with clear and descriptive commit messages.
7. Push your changes to your forked repository.
8. Create a pull request (PR) to the `main` branch of the original repository, including a detailed description of your changes and any related issues or pull requests.
9. Be prepared to address any feedback or comments from the project maintainers and community members.

## Code Review

All code contributions will be reviewed by the project maintainers and community members. Feedback and comments may be provided to improve the code quality, maintainability, and adherence to project standards. Please be responsive to feedback and work collaboratively with the reviewers to address any issues.

## Licensing

By contributing to the Aparat Streamer project, you agree to license your contributions under the same [License](./LICENSE) as the project.

## Conclusion

Thank you for your interest in contributing to the Aparat Streamer project! Your contributions are valuable and help make the project better for everyone. We appreciate your efforts in following the contribution guidelines and Code of Conduct to create a collaborative and inclusive environment.
Loading

0 comments on commit 20b0b1e

Please sign in to comment.