Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key Changes for Video Info improvements #79

Merged
merged 5 commits into from
Nov 19, 2023

Conversation

zakrian07
Copy link
Contributor

Updated and streamlined models to match the current data structure and usage requirements. Enhanced readability and maintainability of the code by removing unused fields and methods. Additions
Added @computed_field and @cached_property decorators for properties in the Video class to handle lazy loading and API interactions. Introduced new utility functions video_link and is_mobile_share_link for generating TikTok video links and checking mobile share links. Added detailed comments and docstrings for clarity and documentation purposes. Fixes and Improvements
SubtitleData Model:

Changed language_id from a mandatory field to an optional field with a default alias (Field(alias='LanguageID')). VideoData Model:

Added optional fields encoded_type, video_quality, encode_user_tag, codec_type, and definition. Ensured optional nature of some fields to handle cases where data might not be available. MusicData Model:

Streamlined fields and ensured they align with the actual data received from the API. LightVideo and Video Models:

Simplified these models by removing attributes and methods not present or necessary in the response structure. General Code Improvements:

Refactored the structure of models for better alignment with the data provided by the TikTok API. Improved code organization and removed redundant or unused code segments. Enhanced error handling in deferred collectors and API interaction methods. Circular Dependency Resolution:

Moved the re-imports of some models (Challenge, LightChallenge, Comment, LightUser, User, UserStats) to the end of the file to resolve circular dependencies. Removed
Eliminated unnecessary methods and properties related to image data handling (image_data and image_url_list) in the Video model, as they were not aligned with the current response structure.

stylienz4u and others added 3 commits November 18, 2023 23:36
Updated and streamlined models to match the current data structure and usage requirements.
Enhanced readability and maintainability of the code by removing unused fields and methods.
Additions
Added @computed_field and @cached_property decorators for properties in the Video class to handle lazy loading and API interactions.
Introduced new utility functions video_link and is_mobile_share_link for generating TikTok video links and checking mobile share links.
Added detailed comments and docstrings for clarity and documentation purposes.
Fixes and Improvements
SubtitleData Model:

Changed language_id from a mandatory field to an optional field with a default alias (Field(alias='LanguageID')).
VideoData Model:

Added optional fields encoded_type, video_quality, encode_user_tag, codec_type, and definition.
Ensured optional nature of some fields to handle cases where data might not be available.
MusicData Model:

Streamlined fields and ensured they align with the actual data received from the API.
LightVideo and Video Models:

Simplified these models by removing attributes and methods not present or necessary in the response structure.
General Code Improvements:

Refactored the structure of models for better alignment with the data provided by the TikTok API.
Improved code organization and removed redundant or unused code segments.
Enhanced error handling in deferred collectors and API interaction methods.
Circular Dependency Resolution:

Moved the re-imports of some models (Challenge, LightChallenge, Comment, LightUser, User, UserStats) to the end of the file to resolve circular dependencies.
Removed
Eliminated unnecessary methods and properties related to image data handling (image_data and image_url_list) in the Video model, as they were not aligned with the current response structure.
@zakrian07
Copy link
Contributor Author

@Russell-Newton it was import issue it was my local src file path i just update try to merge now

@Russell-Newton
Copy link
Owner

I'll try the merge later today or tomorrow when I get back home.

@zakrian07
Copy link
Contributor Author

please run again these were local versions while import for source files tiktokapipy is replaced now everywhere in video.py it should pass validations now

@Russell-Newton
Copy link
Owner

I'm going to merge this in knowing that it doesn't pass validation checks. I'll try to fix them before bumping the version number.

@Russell-Newton Russell-Newton merged commit dc07e80 into Russell-Newton:main Nov 19, 2023
0 of 2 checks passed
Russell-Newton added a commit that referenced this pull request Nov 19, 2023
Issues addressed here: #59, #72, #76
Following PR #79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants