├── README.md ├── YTAPI3 ├── API │ ├── APICalls │ │ ├── MABYT3_APIRequest.h │ │ └── MABYT3_APIRequest.m │ ├── Activity │ │ ├── MABYT3_Activity.h │ │ ├── MABYT3_Activity.m │ │ ├── MABYT3_ActivityContentDetails.h │ │ ├── MABYT3_ActivityContentDetails.m │ │ ├── MABYT3_ActivityPlaylistItem.h │ │ ├── MABYT3_ActivityPlaylistItem.m │ │ ├── MABYT3_ActivityRecommendation.h │ │ ├── MABYT3_ActivityRecommendation.m │ │ ├── MABYT3_ActivitySnippet.h │ │ ├── MABYT3_ActivitySnippet.m │ │ ├── MABYT3_ActivitySocial.h │ │ └── MABYT3_ActivitySocial.m │ ├── Channel │ │ ├── BrandingSettings │ │ │ ├── MABYT3_ChannelBrandingSettings.h │ │ │ ├── MABYT3_ChannelBrandingSettings.m │ │ │ ├── MABYT3_ChannelBrandingSettingsChannel.h │ │ │ ├── MABYT3_ChannelBrandingSettingsChannel.m │ │ │ ├── MABYT3_ChannelBrandingSettingsImage.h │ │ │ ├── MABYT3_ChannelBrandingSettingsImage.m │ │ │ ├── MABYT3_ChannelBrandingSettingsWatch.h │ │ │ ├── MABYT3_ChannelBrandingSettingsWatch.m │ │ │ ├── MABYT3_LocalizedPropertyURL.h │ │ │ ├── MABYT3_LocalizedPropertyURL.m │ │ │ ├── MABYT3_PropertyURL.h │ │ │ └── MABYT3_PropertyURL.m │ │ ├── InVideoPromotion │ │ │ ├── MABYT3_ChannelInvideoPromotion.h │ │ │ ├── MABYT3_ChannelInvideoPromotion.m │ │ │ ├── MABYT3_ChannelInvideoPromotionDefaultTiming.h │ │ │ ├── MABYT3_ChannelInvideoPromotionDefaultTiming.m │ │ │ ├── MABYT3_ChannelInvideoPromotionItem.h │ │ │ ├── MABYT3_ChannelInvideoPromotionItem.m │ │ │ ├── MABYT3_ChannelInvideoPromotionItemIdentifier.h │ │ │ ├── MABYT3_ChannelInvideoPromotionItemIdentifier.m │ │ │ ├── MABYT3_ChannelInvideoPromotionPosition.h │ │ │ └── MABYT3_ChannelInvideoPromotionPosition.m │ │ ├── MABYT3_Channel.h │ │ ├── MABYT3_Channel.m │ │ ├── MABYT3_ChannelAuditDetails.h │ │ ├── MABYT3_ChannelAuditDetails.m │ │ ├── MABYT3_ChannelContentDetails.h │ │ ├── MABYT3_ChannelContentDetails.m │ │ ├── MABYT3_ChannelContentOwnerDetails.h │ │ ├── MABYT3_ChannelContentOwnerDetails.m │ │ ├── MABYT3_ChannelSnippet.h │ │ ├── MABYT3_ChannelSnippet.m │ │ ├── MABYT3_ChannelStatistics.h │ │ ├── MABYT3_ChannelStatistics.m │ │ ├── MABYT3_ChannelStatus.h │ │ └── MABYT3_ChannelStatus.m │ ├── ChannelSection │ │ ├── MABYT3_ChannelSection.h │ │ ├── MABYT3_ChannelSection.m │ │ ├── MABYT3_ChannelSectionContentDetails.h │ │ ├── MABYT3_ChannelSectionContentDetails.m │ │ ├── MABYT3_ChannelSectionSnippet.h │ │ └── MABYT3_ChannelSectionSnippet.m │ ├── MABYT3_ContentRating.h │ ├── MABYT3_ContentRating.m │ ├── MABYT3_GuideCategory.h │ ├── MABYT3_GuideCategory.m │ ├── MABYT3_Language.h │ ├── MABYT3_Language.m │ ├── MABYT3_Location.h │ ├── MABYT3_Location.m │ ├── MABYT3_Region.h │ ├── MABYT3_Region.m │ ├── MABYT3_RegionRestriction.h │ ├── MABYT3_RegionRestriction.m │ ├── MABYT3_ResourceId.h │ ├── MABYT3_ResourceId.m │ ├── MABYT3_Thumbnail.h │ ├── MABYT3_Thumbnail.m │ ├── MABYT3_VideoCategory.h │ ├── MABYT3_VideoCategory.m │ ├── MABYT3_enums.h │ ├── MAB_GDate.h │ ├── MAB_GDate.m │ ├── MAB_GLink.h │ ├── MAB_GLink.m │ ├── PlayList │ │ ├── MABYT3_PlayList.h │ │ ├── MABYT3_PlayList.m │ │ ├── MABYT3_PlayListContentDetails.h │ │ ├── MABYT3_PlayListContentDetails.m │ │ ├── MABYT3_PlayListSnippet.h │ │ └── MABYT3_PlayListSnippet.m │ ├── PlayListItem │ │ ├── MABYT3_PlayListItem.h │ │ ├── MABYT3_PlayListItem.m │ │ ├── MABYT3_PlayListItemContentDetails.h │ │ ├── MABYT3_PlayListItemContentDetails.m │ │ ├── MABYT3_PlayListItemSnippet.h │ │ └── MABYT3_PlayListItemSnippet.m │ ├── SearchItem │ │ ├── MABYT3_SearchItem.h │ │ ├── MABYT3_SearchItem.m │ │ ├── MABYT3_SearchItemSnippet.h │ │ └── MABYT3_SearchItemSnippet.m │ ├── Subscription │ │ ├── MABYT3_SubscriberSnippet.h │ │ ├── MABYT3_SubscriberSnippet.m │ │ ├── MABYT3_Subscription.h │ │ ├── MABYT3_Subscription.m │ │ ├── MABYT3_SubscriptionContentDetails.h │ │ ├── MABYT3_SubscriptionContentDetails.m │ │ ├── MABYT3_SubscriptionSnippet.h │ │ └── MABYT3_SubscriptionSnippet.m │ └── Video │ │ ├── MABYT3_AudioStreams.h │ │ ├── MABYT3_AudioStreams.m │ │ ├── MABYT3_Video.h │ │ ├── MABYT3_Video.m │ │ ├── MABYT3_VideoContentDetails.h │ │ ├── MABYT3_VideoContentDetails.m │ │ ├── MABYT3_VideoFileDetails.h │ │ ├── MABYT3_VideoFileDetails.m │ │ ├── MABYT3_VideoLiveStreamingDetails.h │ │ ├── MABYT3_VideoLiveStreamingDetails.m │ │ ├── MABYT3_VideoProcessingDetails.h │ │ ├── MABYT3_VideoProcessingDetails.m │ │ ├── MABYT3_VideoProcessingProgress.h │ │ ├── MABYT3_VideoProcessingProgress.m │ │ ├── MABYT3_VideoRecordingDetails.h │ │ ├── MABYT3_VideoRecordingDetails.m │ │ ├── MABYT3_VideoSnippet.h │ │ ├── MABYT3_VideoSnippet.m │ │ ├── MABYT3_VideoStatistics.h │ │ ├── MABYT3_VideoStatistics.m │ │ ├── MABYT3_VideoStatus.h │ │ ├── MABYT3_VideoStatus.m │ │ ├── MABYT3_VideoStreams.h │ │ ├── MABYT3_VideoStreams.m │ │ ├── MABYT3_VideoSuggestions.h │ │ └── MABYT3_VideoSuggestions.m └── OAuthFrameWork │ ├── MAB_GoogleAccessToken.h │ ├── MAB_GoogleAccessToken.m │ ├── MAB_GoogleOAuthTouchViewController.h │ ├── MAB_GoogleOAuthTouchViewController.m │ ├── MAB_GoogleUserCredentials.h │ └── MAB_GoogleUserCredentials.m ├── YTAPI3Demo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── muhammadbassio.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── YTAPI3Demo.xcscheme │ └── xcschememanagement.plist ├── YTAPI3Demo ├── Base.lproj │ └── Main.storyboard ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── MABYT3_AppDelegate.h ├── MABYT3_AppDelegate.m ├── MABYT3_ViewController.h ├── MABYT3_ViewController.m ├── YTAPI3Demo-Info.plist ├── YTAPI3Demo-Prefix.pch ├── en.lproj │ └── InfoPlist.strings └── main.m └── YTAPI3DemoTests ├── YTAPI3DemoTests-Info.plist ├── YTAPI3DemoTests.m └── en.lproj └── InfoPlist.strings /README.md: -------------------------------------------------------------------------------- 1 | YouTubeAPI3-Objective-C-wrapper 2 | =============================== 3 | 4 | A simple Objective-C wrapper for most of YouTube API v3.0 functions (including OAuth2.0 implementation). 5 | Designed to make it simple to integrate YouTube functionality within your iOS app. 6 | 7 | 8 | 9 | ## Install 10 | - Drag "YTAPI3" directory to your Xcode project. 11 | - Update the below parameters with yours in "YTAPI3/OAuthFrameWork/MAB_GoogleUserCredentials.h" file 12 | 13 | ``` 14 | static NSString *kMyClientID = @"YourClientID"; 15 | static NSString *kMyClientSecret = @"YourClientSecret"; 16 | static NSString *apiKey = @"YourAPIKey"; 17 | 18 | ``` 19 | 20 | ## Enviroment 21 | This library is ARC enabled, and requires Xcode 5 to be compiled. 22 | Tested on both iOS6 & iOS7, as well as both 32 & 64 bit processors. 23 | 24 | 25 | ## Syntax 26 | Check the demo project 27 | 28 | 29 | ## Youtube Data API v3 30 | - [Youtube Data API v3 Doc](https://developers.google.com/youtube/v3/) 31 | - [Obtain API key from Google API Console](https://console.developers.google.com) 32 | 33 | ##License 34 | 35 | MIT License (MIT) 36 | 37 | ``` 38 | Copyright (c) 2014 MuhammadBassio 39 | 40 | Permission is hereby granted, free of charge, to any person obtaining a copy 41 | of this software and associated documentation files (the "Software"), to deal 42 | in the Software without restriction, including without limitation the rights 43 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 44 | copies of the Software, and to permit persons to whom the Software is 45 | furnished to do so, subject to the following conditions: 46 | 47 | The above copyright notice and this permission notice shall be included in 48 | all copies or substantial portions of the Software. 49 | 50 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 51 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 52 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 53 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 54 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 55 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 56 | THE SOFTWARE. 57 | 58 | ``` 59 | -------------------------------------------------------------------------------- /YTAPI3/API/APICalls/MABYT3_APIRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_LISTRequest.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/6/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MAB_GoogleUserCredentials.h" 11 | #import "MABYT3_Activity.h" 12 | #import "MABYT3_ChannelSection.h" 13 | #import "MABYT3_GuideCategory.h" 14 | #import "MABYT3_Language.h" 15 | #import "MABYT3_Region.h" 16 | #import "MABYT3_PlayListItem.h" 17 | #import "MABYT3_PlayList.h" 18 | #import "MABYT3_VideoCategory.h" 19 | #import "MABYT3_SearchItem.h" 20 | #import "MABYT3_Video.h" 21 | 22 | @interface MABYT3_APIRequest : NSObject 23 | 24 | 25 | + (MABYT3_APIRequest *) sharedInstance; 26 | 27 | 28 | 29 | 30 | - (NSString *)ActivitiesURLforUser:(MABYT3_Channel *)channel withMaxResults:(NSInteger)max; 31 | - (NSString *)ActivitiesURLforHomeWithMaxResults:(NSInteger)max; 32 | - (NSString *)ActivitiesURLforMeWithMaxResults:(NSInteger)max; 33 | 34 | - (NSString *) GuidedCategoriesURLforRegion:(NSString *)reg andLanguage:(NSString *)lang; 35 | - (NSString *) LanguagesURLforLanguae:(NSString *)lang; 36 | - (NSString *) RegionsURLforLanguae:(NSString *)lang; 37 | 38 | 39 | - (NSString *) PlayListItemsURLforPlayList:(NSString *)playlistId withMaxResults:(NSInteger)max; 40 | - (NSString *) PlayListsURLforMewithMaxResults:(NSInteger)max; 41 | - (NSString *) PlayListsURLforChannel:(NSString *)channelId withMaxResults:(NSInteger)max; 42 | - (NSString *) PlayListsURLforPlayList:(NSString *)playlistId withMaxResults:(NSInteger)max; 43 | 44 | 45 | - (NSString *) VideoSearchURLforTerm:(NSString *)term withParameters:(NSDictionary *)params andMaxResults:(NSInteger)max; 46 | - (NSString *) ChannelSearchURLforTerm:(NSString *)term withParameters:(NSDictionary *)params andMaxResults:(NSInteger)max; 47 | - (NSString *) PlayListSearchURLforTerm:(NSString *)term withParameters:(NSDictionary *)params andMaxResults:(NSInteger)max; 48 | 49 | - (NSString *) VideoURLforVideo:(NSString *)videoId withMaxResults:(NSInteger)max; 50 | - (NSString *) ChannelURLforId:(NSString *)channelId withMaxResults:(NSInteger)max; 51 | 52 | 53 | 54 | - (void) LISTActivitiesForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *, NSString *))handler; 55 | - (void) LISTChannelSectionsForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *))handler; 56 | - (void) LISTChannelsForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *))handler; 57 | - (void) LISTGuideCategoriesForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *))handler; 58 | - (void) LISTLanguagesForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *))handler; 59 | - (void) LISTRegionsForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *))handler; 60 | - (void) LISTPlayListItemsForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *, NSString *))handler; 61 | - (void) LISTPlayListsForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *, NSString *))handler; 62 | - (void) LISTVideoCategoriesForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *))handler; 63 | - (void) LISTSearchItemsForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *, NSString *))handler; 64 | - (void) LISTSubscriptionsForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *, NSString *))handler; 65 | - (void) LISTVideosForURL:(NSString *)urlStr andHandler:(void (^)(NSMutableArray *, NSError *, NSString *))handler; 66 | 67 | 68 | - (void) LIKEVideo:(NSString *)videoId andHandler:(void (^)(NSError *, BOOL))handler; 69 | - (void) DISLIKEVideo:(NSString *)videoId andHandler:(void (^)(NSError *, BOOL))handler; 70 | 71 | - (void) INSERTSubscription:(NSString *)channelId andHandler:(void (^)(NSError *, BOOL))handler; 72 | - (void) INSERTVideo:(NSString *)videoId inPlayList:(NSString *)playlistID atPosition:(NSInteger)pos andHandler:(void (^)(NSError *, BOOL))handler; 73 | - (void) INSERTPlayList:(NSString *)playlistTitle withDescription:(NSString *)desc andPrivacyStatus:(YTPrivacyStatus)status andHandler:(void (^)(NSError *, NSString *,BOOL))handler; 74 | - (void) INSERTPlayList:(NSString *)playlistTitle andDescription:(NSString *)desc andHandler:(void (^)(NSError *, NSString *, BOOL))handler; 75 | 76 | 77 | - (void) UPDATEPlayListItem:(NSString *)itemId withVideo:(NSString *)videoId inPlayList:(NSString *)playlistID atPosition:(NSInteger)pos andHandler:(void (^)(NSError *, BOOL))handler; 78 | - (void) UPDATEPlayList:(NSString *)playlistID withTitle:(NSString *)playlistTitle withDescription:(NSString *)desc andPrivacyStatus:(YTPrivacyStatus)status andHandler:(void (^)(NSError *, BOOL))handler; 79 | - (void) UPDATEPlayList:(NSString *)playlistID withTitle:(NSString *)playlistTitle andDescription:(NSString *)desc andHandler:(void (^)(NSError *, BOOL))handler; 80 | 81 | 82 | 83 | - (void) DELETEPlayListItem:(NSString *)itemId withHandler:(void (^)(NSError *, BOOL))handler; 84 | - (void) DELETEPlayList:(NSString *)playlistID withHandler:(void (^)(NSError *, BOOL))handler; 85 | - (void) DELETESubscription:(NSString *)subscriptionId andHandler:(void (^)(NSError *, BOOL))handler; 86 | 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_Activity.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Activity.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#properties 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_ActivitySnippet.h" 13 | #import "MABYT3_ActivityContentDetails.h" 14 | 15 | @interface MABYT3_Activity : NSObject 16 | 17 | @property (strong, nonatomic) NSString *kind; 18 | @property (strong, nonatomic) NSString *etag; 19 | @property (strong, nonatomic) NSString *identifier; 20 | @property (strong, nonatomic) MABYT3_ActivitySnippet *snippet; 21 | @property (strong, nonatomic) MABYT3_ActivityContentDetails *contentDetails; 22 | 23 | - (id) initFromDictionary:(NSDictionary *)dict; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_Activity.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Activity.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#properties 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_Activity.h" 12 | 13 | @implementation MABYT3_Activity 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#subscription"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _snippet = [[MABYT3_ActivitySnippet alloc] init]; 23 | _contentDetails = [[MABYT3_ActivityContentDetails alloc] init]; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _kind = @"youtube#subscription"; 33 | _etag = @""; 34 | _identifier = @""; 35 | _snippet = [[MABYT3_ActivitySnippet alloc] init]; 36 | _contentDetails = [[MABYT3_ActivityContentDetails alloc] init]; 37 | 38 | if ([dict objectForKey:@"kind"]) { 39 | _kind = [dict objectForKey:@"kind"]; 40 | } 41 | if ([dict objectForKey:@"etag"]) { 42 | _etag = [dict objectForKey:@"etag"]; 43 | } 44 | if ([dict objectForKey:@"id"]) { 45 | _identifier = [dict objectForKey:@"id"]; 46 | } 47 | if ([dict objectForKey:@"snippet"]) { 48 | _snippet = [[MABYT3_ActivitySnippet alloc] initFromDictionary:[dict objectForKey:@"snippet"]]; 49 | } 50 | if ([dict objectForKey:@"contentDetails"]) { 51 | _contentDetails = [[MABYT3_ActivityContentDetails alloc] initFromDictionary:[dict objectForKey:@"contentDetails"]]; 52 | } 53 | } 54 | return self; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_ActivityContentDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ActivityContentDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#contentDetails 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_ActivityPlaylistItem.h" 13 | #import "MABYT3_ActivityRecommendation.h" 14 | #import "MABYT3_ActivitySocial.h" 15 | 16 | @interface MABYT3_ActivityContentDetails : NSObject 17 | 18 | @property (strong, nonatomic) MABYT3_ResourceId *upload; 19 | @property (strong, nonatomic) MABYT3_ResourceId *like; 20 | @property (strong, nonatomic) MABYT3_ResourceId *favorite; 21 | @property (strong, nonatomic) MABYT3_ResourceId *comment; 22 | @property (strong, nonatomic) MABYT3_ResourceId *subscription; 23 | @property (strong, nonatomic) MABYT3_ResourceId *bulletin; 24 | @property (strong, nonatomic) MABYT3_ResourceId *channelItem; 25 | @property (strong, nonatomic) MABYT3_ActivityPlaylistItem *playlistItem; 26 | @property (strong, nonatomic) MABYT3_ActivityRecommendation *recommendation; 27 | @property (strong, nonatomic) MABYT3_ActivitySocial *social; 28 | 29 | - (id) initFromDictionary:(NSDictionary *)dict; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_ActivityContentDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ActivityContentDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#contentDetails 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ActivityContentDetails.h" 12 | 13 | @implementation MABYT3_ActivityContentDetails 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _upload = [[MABYT3_ResourceId alloc] init]; 20 | _like = [[MABYT3_ResourceId alloc] init]; 21 | _favorite = [[MABYT3_ResourceId alloc] init]; 22 | _comment = [[MABYT3_ResourceId alloc] init]; 23 | _subscription = [[MABYT3_ResourceId alloc] init]; 24 | _bulletin = [[MABYT3_ResourceId alloc] init]; 25 | _channelItem = [[MABYT3_ResourceId alloc] init]; 26 | _playlistItem = [[MABYT3_ActivityPlaylistItem alloc] init]; 27 | _recommendation = [[MABYT3_ActivityRecommendation alloc] init]; 28 | _social = [[MABYT3_ActivitySocial alloc] init]; 29 | } 30 | return self; 31 | } 32 | 33 | - (id) initFromDictionary:(NSDictionary *)dict { 34 | 35 | self = [super init]; 36 | if (self) { 37 | _upload = [[MABYT3_ResourceId alloc] init]; 38 | _like = [[MABYT3_ResourceId alloc] init]; 39 | _favorite = [[MABYT3_ResourceId alloc] init]; 40 | _comment = [[MABYT3_ResourceId alloc] init]; 41 | _subscription = [[MABYT3_ResourceId alloc] init]; 42 | _bulletin = [[MABYT3_ResourceId alloc] init]; 43 | _channelItem = [[MABYT3_ResourceId alloc] init]; 44 | _playlistItem = [[MABYT3_ActivityPlaylistItem alloc] init]; 45 | _recommendation = [[MABYT3_ActivityRecommendation alloc] init]; 46 | _social = [[MABYT3_ActivitySocial alloc] init]; 47 | 48 | if ([dict objectForKey:@"upload"]) { 49 | _upload = [[MABYT3_ResourceId alloc] initFromDictionary:[dict objectForKey:@"upload"]]; 50 | } 51 | if ([dict objectForKey:@"playlistItem"]) { 52 | _playlistItem = [[MABYT3_ActivityPlaylistItem alloc] initFromDictionary:[dict objectForKey:@"playlistItem"]]; 53 | } 54 | if ([dict objectForKey:@"recommendation"]) { 55 | _recommendation = [[MABYT3_ActivityRecommendation alloc] initFromDictionary:[dict objectForKey:@"recommendation"]]; 56 | } 57 | if ([dict objectForKey:@"social"]) { 58 | _social = [[MABYT3_ActivitySocial alloc] initFromDictionary:[dict objectForKey:@"social"]]; 59 | } 60 | if ([dict objectForKey:@"like"]) { 61 | if ([[dict objectForKey:@"like"] objectForKey:@"resourceId"]) { 62 | _like = [[MABYT3_ResourceId alloc] initFromDictionary:[[dict objectForKey:@"like"] objectForKey:@"resourceId"]]; 63 | } 64 | } 65 | if ([dict objectForKey:@"favorite"]) { 66 | if ([[dict objectForKey:@"favorite"] objectForKey:@"resourceId"]) { 67 | _favorite = [[MABYT3_ResourceId alloc] initFromDictionary:[[dict objectForKey:@"favorite"] objectForKey:@"resourceId"]]; 68 | } 69 | } 70 | if ([dict objectForKey:@"comment"]) { 71 | if ([[dict objectForKey:@"comment"] objectForKey:@"resourceId"]) { 72 | _comment = [[MABYT3_ResourceId alloc] initFromDictionary:[[dict objectForKey:@"comment"] objectForKey:@"resourceId"]]; 73 | } 74 | } 75 | if ([dict objectForKey:@"subscription"]) { 76 | if ([[dict objectForKey:@"subscription"] objectForKey:@"resourceId"]) { 77 | _subscription = [[MABYT3_ResourceId alloc] initFromDictionary:[[dict objectForKey:@"subscription"] objectForKey:@"resourceId"]]; 78 | } 79 | } 80 | if ([dict objectForKey:@"bulletin"]) { 81 | if ([[dict objectForKey:@"bulletin"] objectForKey:@"resourceId"]) { 82 | _bulletin = [[MABYT3_ResourceId alloc] initFromDictionary:[[dict objectForKey:@"bulletin"] objectForKey:@"resourceId"]]; 83 | } 84 | } 85 | if ([dict objectForKey:@"channelItem"]) { 86 | if ([[dict objectForKey:@"channelItem"] objectForKey:@"resourceId"]) { 87 | _channelItem = [[MABYT3_ResourceId alloc] initFromDictionary:[[dict objectForKey:@"channelItem"] objectForKey:@"resourceId"]]; 88 | } 89 | } 90 | 91 | 92 | 93 | } 94 | return self; 95 | } 96 | 97 | @end 98 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_ActivityPlaylistItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ActivityPlaylistItem.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#playlistItem 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_ResourceId.h" 13 | 14 | @interface MABYT3_ActivityPlaylistItem : NSObject 15 | 16 | @property (strong, nonatomic) NSString *playlistId; 17 | @property (strong, nonatomic) NSString *playlistItemId; 18 | @property (strong, nonatomic) MABYT3_ResourceId *resourceId; 19 | 20 | - (id) initFromDictionary:(NSDictionary *)dict; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_ActivityPlaylistItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ActivityPlaylistItem.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#playlistItem 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ActivityPlaylistItem.h" 12 | 13 | @implementation MABYT3_ActivityPlaylistItem 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _playlistId = @""; 20 | _playlistItemId = @""; 21 | _resourceId = [[MABYT3_ResourceId alloc] init]; 22 | } 23 | return self; 24 | } 25 | 26 | - (id) initFromDictionary:(NSDictionary *)dict { 27 | 28 | self = [super init]; 29 | if (self) { 30 | _playlistId = @""; 31 | _playlistItemId = @""; 32 | _resourceId = [[MABYT3_ResourceId alloc] init]; 33 | 34 | if ([dict objectForKey:@"playlistId"]) { 35 | _playlistId = [dict objectForKey:@"playlistId"]; 36 | } 37 | if ([dict objectForKey:@"playlistItemId"]) { 38 | _playlistItemId = [dict objectForKey:@"playlistItemId"]; 39 | } 40 | if ([dict objectForKey:@"resourceId"]) { 41 | _resourceId = [[MABYT3_ResourceId alloc] initFromDictionary:[dict objectForKey:@"resourceId"]]; 42 | } 43 | 44 | 45 | } 46 | return self; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_ActivityRecommendation.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ActivityRecommendation.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#recommendation 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_ResourceId.h" 13 | 14 | @interface MABYT3_ActivityRecommendation : NSObject 15 | 16 | @property (strong, nonatomic) MABYT3_ResourceId *resourceId; 17 | @property (strong, nonatomic) NSString *reason; 18 | @property (strong, nonatomic) MABYT3_ResourceId *seedResourceId; 19 | 20 | - (id) initFromDictionary:(NSDictionary *)dict; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_ActivityRecommendation.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ActivityRecommendation.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#recommendation 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ActivityRecommendation.h" 12 | 13 | @implementation MABYT3_ActivityRecommendation 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _resourceId = [[MABYT3_ResourceId alloc] init]; 20 | _seedResourceId = [[MABYT3_ResourceId alloc] init]; 21 | _reason = @""; 22 | } 23 | return self; 24 | } 25 | 26 | - (id) initFromDictionary:(NSDictionary *)dict { 27 | 28 | self = [super init]; 29 | if (self) { 30 | _resourceId = [[MABYT3_ResourceId alloc] init]; 31 | _seedResourceId = [[MABYT3_ResourceId alloc] init]; 32 | _reason = @""; 33 | 34 | if ([dict objectForKey:@"reason"]) { 35 | _reason = [dict objectForKey:@"reason"]; 36 | } 37 | if ([dict objectForKey:@"resourceId"]) { 38 | _resourceId = [[MABYT3_ResourceId alloc] initFromDictionary:[dict objectForKey:@"resourceId"]]; 39 | } 40 | if ([dict objectForKey:@"seedResourceId"]) { 41 | _seedResourceId = [[MABYT3_ResourceId alloc] initFromDictionary:[dict objectForKey:@"seedResourceId"]]; 42 | } 43 | 44 | 45 | } 46 | return self; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_ActivitySnippet.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ActivitySnippet.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MAB_GDate.h" 13 | #import "MABYT3_Thumbnail.h" 14 | #import "MABYT3_enums.h" 15 | 16 | @interface MABYT3_ActivitySnippet : NSObject 17 | 18 | @property (strong, nonatomic) MAB_GDate *publishedAt; 19 | @property (strong, nonatomic) NSString *channelId; 20 | @property (strong, nonatomic) NSString *title; 21 | @property (strong, nonatomic) NSString *description; 22 | @property (strong, nonatomic) NSMutableDictionary *thumbnails; 23 | @property (strong, nonatomic) NSString *channelTitle; 24 | @property (nonatomic) YTActivityFeedType type; 25 | @property (strong, nonatomic) NSString *groupId; 26 | 27 | - (id) initFromDictionary:(NSDictionary *)dict; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_ActivitySnippet.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ActivitySnippet.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ActivitySnippet.h" 12 | 13 | @implementation MABYT3_ActivitySnippet 14 | 15 | @synthesize description = _description; 16 | 17 | - (id) init { 18 | 19 | self = [super init]; 20 | if (self) { 21 | _publishedAt = [[MAB_GDate alloc] init]; 22 | _channelId = @""; 23 | _title = @""; 24 | _description = @""; 25 | _thumbnails = [[NSMutableDictionary alloc] init]; 26 | _channelTitle = @""; 27 | _type = kYTActivityUpload; 28 | _groupId = @""; 29 | } 30 | return self; 31 | } 32 | 33 | - (id) initFromDictionary:(NSDictionary *)dict { 34 | 35 | self = [super init]; 36 | if (self) { 37 | _publishedAt = [[MAB_GDate alloc] init]; 38 | _channelId = @""; 39 | _title = @""; 40 | _description = @""; 41 | _thumbnails = [[NSMutableDictionary alloc] init]; 42 | _channelTitle = @""; 43 | _type = kYTActivityUpload; 44 | _groupId = @""; 45 | 46 | if ([dict objectForKey:@"publishedAt"]) { 47 | _publishedAt = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"publishedAt"]]; 48 | } 49 | if ([dict objectForKey:@"channelId"]) { 50 | _channelId = [dict objectForKey:@"channelId"]; 51 | } 52 | if ([dict objectForKey:@"title"]) { 53 | _title = [dict objectForKey:@"title"]; 54 | } 55 | if ([dict objectForKey:@"description"]) { 56 | _description = [dict objectForKey:@"description"]; 57 | } 58 | if ([dict objectForKey:@"channelTitle"]) { 59 | _channelTitle = [dict objectForKey:@"channelTitle"]; 60 | } 61 | 62 | if ([dict objectForKey:@"type"]) { 63 | _type = [self feedTypeFromString:[dict objectForKey:@"type"]]; 64 | } 65 | 66 | if ([dict objectForKey:@"thumbnails"]) { 67 | NSDictionary *thmbDict = [dict objectForKey:@"thumbnails"]; 68 | NSArray *keys = [thmbDict allKeys]; 69 | for (int i = 0; i < keys.count; i++) { 70 | MABYT3_Thumbnail *thmb = [[MABYT3_Thumbnail alloc] initFromDictionary:[thmbDict objectForKey:keys[i]]]; 71 | [_thumbnails setObject:thmb forKey:keys[i]]; 72 | } 73 | } 74 | } 75 | return self; 76 | } 77 | 78 | - (YTActivityFeedType) feedTypeFromString:(NSString *)feedString { 79 | 80 | YTActivityFeedType retVal = kYTActivityUpload; 81 | 82 | if ([feedString isEqualToString:@"bulletin"]) { 83 | retVal = kYTActivityBulletin; 84 | } 85 | else if ([feedString isEqualToString:@"channelItem"]) { 86 | retVal = kYTActivityChannelItem; 87 | } 88 | else if ([feedString isEqualToString:@"comment"]) { 89 | retVal = kYTActivityComment; 90 | } 91 | else if ([feedString isEqualToString:@"favorite"]) { 92 | retVal = kYTActivityFavorite; 93 | } 94 | else if ([feedString isEqualToString:@"like"]) { 95 | retVal = kYTActivityLike; 96 | } 97 | else if ([feedString isEqualToString:@"playlistItem"]) { 98 | retVal = kYTActivityPlaylistItem; 99 | } 100 | else if ([feedString isEqualToString:@"recommendation"]) { 101 | retVal = kYTActivityRecommendation; 102 | } 103 | else if ([feedString isEqualToString:@"social"]) { 104 | retVal = kYTActivitySocial; 105 | } 106 | else if ([feedString isEqualToString:@"subscription"]) { 107 | retVal = kYTActivitySubscription; 108 | } 109 | return retVal; 110 | } 111 | 112 | 113 | @end 114 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_ActivitySocial.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ActivitySocial.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#social 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_ResourceId.h" 13 | 14 | @interface MABYT3_ActivitySocial : NSObject 15 | 16 | @property (strong, nonatomic) NSString *type; 17 | @property (strong, nonatomic) MABYT3_ResourceId *resourceId; 18 | @property (strong, nonatomic) NSString *author; 19 | @property (strong, nonatomic) NSString *referenceUrl; 20 | @property (strong, nonatomic) NSString *imageUrl; 21 | 22 | - (id) initFromDictionary:(NSDictionary *)dict; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /YTAPI3/API/Activity/MABYT3_ActivitySocial.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ActivitySocial.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/activities#social 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ActivitySocial.h" 12 | 13 | @implementation MABYT3_ActivitySocial 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _type = @""; 20 | _resourceId = [[MABYT3_ResourceId alloc] init]; 21 | _author = @""; 22 | _referenceUrl = @""; 23 | _imageUrl = @""; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _type = @""; 33 | _resourceId = [[MABYT3_ResourceId alloc] init]; 34 | _author = @""; 35 | _referenceUrl = @""; 36 | _imageUrl = @""; 37 | 38 | if ([dict objectForKey:@"type"]) { 39 | _type = [dict objectForKey:@"type"]; 40 | } 41 | if ([dict objectForKey:@"resourceId"]) { 42 | _resourceId = [[MABYT3_ResourceId alloc] initFromDictionary:[dict objectForKey:@"resourceId"]]; 43 | } 44 | if ([dict objectForKey:@"author"]) { 45 | _author = [dict objectForKey:@"author"]; 46 | } 47 | if ([dict objectForKey:@"referenceUrl"]) { 48 | _referenceUrl = [dict objectForKey:@"referenceUrl"]; 49 | } 50 | if ([dict objectForKey:@"imageUrl"]) { 51 | _imageUrl = [dict objectForKey:@"imageUrl"]; 52 | } 53 | 54 | 55 | } 56 | return self; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_ChannelBrandingSettings.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelBrandingSettings.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#brandingSettings 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_ChannelBrandingSettingsChannel.h" 13 | #import "MABYT3_ChannelBrandingSettingsWatch.h" 14 | #import "MABYT3_ChannelBrandingSettingsImage.h" 15 | 16 | 17 | @interface MABYT3_ChannelBrandingSettings : NSObject 18 | 19 | @property (strong, nonatomic) MABYT3_ChannelBrandingSettingsChannel *channel; 20 | @property (strong, nonatomic) MABYT3_ChannelBrandingSettingsWatch *watch; 21 | @property (strong, nonatomic) MABYT3_ChannelBrandingSettingsImage *image; 22 | @property (strong, nonatomic) NSMutableArray *hints; 23 | 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_ChannelBrandingSettings.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelBrandingSettings.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#brandingSettings 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelBrandingSettings.h" 12 | 13 | @implementation MABYT3_ChannelBrandingSettings 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _channel = [[MABYT3_ChannelBrandingSettingsChannel alloc] init]; 20 | _watch = [[MABYT3_ChannelBrandingSettingsWatch alloc] init]; 21 | _image = [[MABYT3_ChannelBrandingSettingsImage alloc] init]; 22 | _hints = [[NSMutableArray alloc] init]; 23 | } 24 | return self; 25 | } 26 | 27 | - (id) initFromDictionary:(NSDictionary *)dict { 28 | 29 | self = [super init]; 30 | if (self) { 31 | _channel = [[MABYT3_ChannelBrandingSettingsChannel alloc] init]; 32 | _watch = [[MABYT3_ChannelBrandingSettingsWatch alloc] init]; 33 | _image = [[MABYT3_ChannelBrandingSettingsImage alloc] init]; 34 | _hints = [[NSMutableArray alloc] init]; 35 | 36 | if ([dict objectForKey:@"channel"]) { 37 | _channel = [[MABYT3_ChannelBrandingSettingsChannel alloc] initFromDictionary:[dict objectForKey:@"channel"]]; 38 | } 39 | if ([dict objectForKey:@"watch"]) { 40 | _watch = [[MABYT3_ChannelBrandingSettingsWatch alloc] initFromDictionary:[dict objectForKey:@"watch"]]; 41 | } 42 | if ([dict objectForKey:@"image"]) { 43 | _image = [[MABYT3_ChannelBrandingSettingsImage alloc] initFromDictionary:[dict objectForKey:@"image"]]; 44 | } 45 | if ([dict objectForKey:@"hints"]) { 46 | _image = [dict objectForKey:@"hints"]; 47 | } 48 | 49 | } 50 | return self; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_ChannelBrandingSettingsChannel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelBrandingSettingsChannel.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#brandingSettings.channel 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_ChannelBrandingSettingsChannel : NSObject 14 | 15 | @property (strong, nonatomic) NSString *title; 16 | @property (strong, nonatomic) NSString *description; 17 | @property (strong, nonatomic) NSString *keywords; 18 | @property (strong, nonatomic) NSString *defaultTab; 19 | @property (strong, nonatomic) NSString *trackingAnalyticsAccountId; 20 | @property (nonatomic) BOOL moderateComments; 21 | @property (nonatomic) BOOL showRelatedChannels; 22 | @property (nonatomic) BOOL showBrowseView; 23 | @property (strong, nonatomic) NSString *featuredChannelsTitle; 24 | @property (strong, nonatomic) NSMutableArray *featuredChannelsUrls; 25 | @property (strong, nonatomic) NSString *unsubscribedTrailer; 26 | @property (strong, nonatomic) NSString *profileColor; 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_ChannelBrandingSettingsChannel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelBrandingSettingsChannel.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#brandingSettings.channel 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelBrandingSettingsChannel.h" 12 | 13 | @implementation MABYT3_ChannelBrandingSettingsChannel 14 | 15 | @synthesize description = _description; 16 | 17 | - (id) init { 18 | 19 | self = [super init]; 20 | if (self) { 21 | _title = @""; 22 | _description = @""; 23 | _keywords = @""; 24 | _defaultTab = @""; 25 | _trackingAnalyticsAccountId = @""; 26 | _moderateComments = NO; 27 | _showRelatedChannels = NO; 28 | _showBrowseView = NO; 29 | _featuredChannelsTitle = @""; 30 | _featuredChannelsUrls = [[NSMutableArray alloc] init]; 31 | _unsubscribedTrailer = @""; 32 | _profileColor = @""; 33 | } 34 | return self; 35 | } 36 | 37 | - (id) initFromDictionary:(NSDictionary *)dict { 38 | 39 | self = [super init]; 40 | if (self) { 41 | _title = @""; 42 | _description = @""; 43 | _keywords = @""; 44 | _defaultTab = @""; 45 | _trackingAnalyticsAccountId = @""; 46 | _moderateComments = NO; 47 | _showRelatedChannels = NO; 48 | _showBrowseView = NO; 49 | _featuredChannelsTitle = @""; 50 | _featuredChannelsUrls = [[NSMutableArray alloc] init]; 51 | _unsubscribedTrailer = @""; 52 | _profileColor = @""; 53 | 54 | if ([dict objectForKey:@"title"]) { 55 | _title = [dict objectForKey:@"title"]; 56 | } 57 | if ([dict objectForKey:@"description"]) { 58 | _description = [dict objectForKey:@"description"]; 59 | } 60 | if ([dict objectForKey:@"keywords"]) { 61 | _keywords = [dict objectForKey:@"keywords"]; 62 | } 63 | if ([dict objectForKey:@"defaultTab"]) { 64 | _defaultTab = [dict objectForKey:@"defaultTab"]; 65 | } 66 | if ([dict objectForKey:@"trackingAnalyticsAccountId"]) { 67 | _trackingAnalyticsAccountId = [dict objectForKey:@"trackingAnalyticsAccountId"]; 68 | } 69 | if ([dict objectForKey:@"moderateComments"]) { 70 | if ([[dict objectForKey:@"moderateComments"] integerValue] > 0) { 71 | _moderateComments = YES; 72 | } 73 | } 74 | if ([dict objectForKey:@"showRelatedChannels"]) { 75 | if ([[dict objectForKey:@"showRelatedChannels"] integerValue] > 0) { 76 | _showRelatedChannels = YES; 77 | } 78 | } 79 | if ([dict objectForKey:@"showBrowseView"]) { 80 | if ([[dict objectForKey:@"showBrowseView"] integerValue] > 0) { 81 | _showBrowseView = YES; 82 | } 83 | } 84 | if ([dict objectForKey:@"featuredChannelsTitle"]) { 85 | _featuredChannelsTitle = [dict objectForKey:@"featuredChannelsTitle"]; 86 | } 87 | if ([dict objectForKey:@"featuredChannelsUrls"]) { 88 | _featuredChannelsUrls = [dict objectForKey:@"featuredChannelsUrls"]; 89 | } 90 | if ([dict objectForKey:@"unsubscribedTrailer"]) { 91 | _unsubscribedTrailer = [dict objectForKey:@"unsubscribedTrailer"]; 92 | } 93 | if ([dict objectForKey:@"profileColor"]) { 94 | _profileColor = [dict objectForKey:@"profileColor"]; 95 | } 96 | } 97 | return self; 98 | } 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_ChannelBrandingSettingsImage.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelBrandingSettingsImage.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#brandingSettings.image 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_PropertyURL.h" 13 | 14 | @interface MABYT3_ChannelBrandingSettingsImage : NSObject 15 | 16 | @property (strong, nonatomic) NSString *bannerImageUrl; // 1060 x 175 17 | @property (strong, nonatomic) NSString *bannerMobileImageUrl; // 640 x 175 18 | @property (strong, nonatomic) MABYT3_PropertyURL *backgroundImageUrl; // 1200 x 615 19 | @property (strong, nonatomic) MABYT3_PropertyURL *largeBrandedBannerImageImapScript; // 20 | @property (strong, nonatomic) MABYT3_PropertyURL *largeBrandedBannerImageUrl; // 854 x 70 21 | @property (strong, nonatomic) MABYT3_PropertyURL *smallBrandedBannerImageImapScript; // 22 | @property (strong, nonatomic) MABYT3_PropertyURL *smallBrandedBannerImageUrl; // 640 x 70 23 | @property (strong, nonatomic) NSString *watchIconImageUrl; // 170 x 25 (max width, constant height) 24 | @property (strong, nonatomic) NSString *trackingImageUrl; // 1 x 1 25 | @property (strong, nonatomic) NSString *bannerTabletLowImageUrl; // 1138 x 188 26 | @property (strong, nonatomic) NSString *bannerTabletImageUrl; // 1707 x 283 27 | @property (strong, nonatomic) NSString *bannerTabletHdImageUrl; // 2276 x 377 28 | @property (strong, nonatomic) NSString *bannerTabletExtraHdImageUrl; // 2560 x 424 29 | @property (strong, nonatomic) NSString *bannerMobileLowImageUrl; // 320 x 88 30 | @property (strong, nonatomic) NSString *bannerMobileMediumHdImageUrl; // 960 x 263 31 | @property (strong, nonatomic) NSString *bannerMobileHdImageUrl; // 1280 x 360 32 | @property (strong, nonatomic) NSString *bannerMobileExtraHdImageUrl; // 1440 x 395 33 | @property (strong, nonatomic) NSString *bannerTvImageUrl; // 2120 x 1192 34 | @property (strong, nonatomic) NSString *bannerTvLowImageUrl; // 854 x 480 35 | @property (strong, nonatomic) NSString *bannerTvMediumImageUrl; // 1280 x 720 36 | @property (strong, nonatomic) NSString *bannerTvHighImageUrl; // 1920 x 1080 37 | @property (strong, nonatomic) NSString *bannerExternalUrl; // used in updating only (i.e. insert not list) 38 | 39 | - (id) initFromDictionary:(NSDictionary *)dict; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_ChannelBrandingSettingsWatch.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelBrandingSettingsWatch.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#brandingSettings.watch 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_ChannelBrandingSettingsWatch : NSObject 14 | 15 | @property (strong, nonatomic) NSString *textColor; 16 | @property (strong, nonatomic) NSString *backgroundColor; 17 | @property (strong, nonatomic) NSString *featuredPlaylistId; 18 | 19 | - (id) initFromDictionary:(NSDictionary *)dict; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_ChannelBrandingSettingsWatch.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelBrandingSettingsWatch.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#brandingSettings.watch 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelBrandingSettingsWatch.h" 12 | 13 | @implementation MABYT3_ChannelBrandingSettingsWatch 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _textColor = @""; 20 | _backgroundColor = @""; 21 | _featuredPlaylistId = @""; 22 | } 23 | return self; 24 | } 25 | 26 | - (id) initFromDictionary:(NSDictionary *)dict { 27 | 28 | self = [super init]; 29 | if (self) { 30 | _textColor = @""; 31 | _backgroundColor = @""; 32 | _featuredPlaylistId = @""; 33 | 34 | if ([dict objectForKey:@"textColor"]) { 35 | _textColor = [dict objectForKey:@"textColor"]; 36 | } 37 | if ([dict objectForKey:@"backgroundColor"]) { 38 | _backgroundColor = [dict objectForKey:@"backgroundColor"]; 39 | } 40 | if ([dict objectForKey:@"featuredPlaylistId"]) { 41 | _featuredPlaylistId = [dict objectForKey:@"featuredPlaylistId"]; 42 | } 43 | } 44 | return self; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_LocalizedPropertyURL.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_LocalizedImageURL.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_LocalizedPropertyURL : NSObject 12 | 13 | @property (strong, nonatomic) NSString *URLvalue; 14 | @property (strong, nonatomic) NSString *language; 15 | 16 | - (id) initFromDictionary:(NSDictionary *)dict; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_LocalizedPropertyURL.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_LocalizedImageURL.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_LocalizedPropertyURL.h" 10 | 11 | @implementation MABYT3_LocalizedPropertyURL 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _URLvalue = @""; 18 | _language = @""; 19 | } 20 | return self; 21 | } 22 | 23 | - (id) initFromDictionary:(NSDictionary *)dict { 24 | 25 | self = [super init]; 26 | if (self) { 27 | _URLvalue = @""; 28 | _language = @""; 29 | 30 | if ([dict objectForKey:@"value"]) { 31 | _URLvalue = [dict objectForKey:@"value"]; 32 | } 33 | if ([dict objectForKey:@"language"]) { 34 | _language = [dict objectForKey:@"language"]; 35 | } 36 | } 37 | return self; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_PropertyURL.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ImageURL.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MABYT3_LocalizedPropertyURL.h" 11 | 12 | @interface MABYT3_PropertyURL : NSObject 13 | 14 | @property (strong, nonatomic) NSString *defaultURL; 15 | @property (strong, nonatomic) NSMutableArray *localizedURLs; 16 | 17 | - (id) initFromDictionary:(NSDictionary *)dict; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/BrandingSettings/MABYT3_PropertyURL.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ImageURL.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_PropertyURL.h" 10 | 11 | @implementation MABYT3_PropertyURL 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _defaultURL = @""; 18 | _localizedURLs = [[NSMutableArray alloc] init]; 19 | } 20 | return self; 21 | } 22 | 23 | - (id) initFromDictionary:(NSDictionary *)dict { 24 | 25 | self = [super init]; 26 | if (self) { 27 | _defaultURL = @""; 28 | _localizedURLs = [[NSMutableArray alloc] init]; 29 | 30 | if ([dict objectForKey:@"default"]) { 31 | _defaultURL = [dict objectForKey:@"default"]; 32 | } 33 | if ([dict objectForKey:@"localized"]) { 34 | NSArray *values = [dict objectForKey:@"localized"]; 35 | if (values.count > 0) { 36 | for (int i = 0; i < values.count; i++) { 37 | NSDictionary *vdict = values[i]; 38 | MABYT3_LocalizedPropertyURL *locIM = [[MABYT3_LocalizedPropertyURL alloc] initFromDictionary:vdict]; 39 | [_localizedURLs addObject:locIM]; 40 | } 41 | } 42 | } 43 | } 44 | return self; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/InVideoPromotion/MABYT3_ChannelInvideoPromotion.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelInvideoPromotion.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#invideoPromotion 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_ChannelInvideoPromotionDefaultTiming.h" 13 | #import "MABYT3_ChannelInvideoPromotionPosition.h" 14 | #import "MABYT3_ChannelInvideoPromotionItem.h" 15 | 16 | @interface MABYT3_ChannelInvideoPromotion : NSObject 17 | 18 | @property (strong, nonatomic) MABYT3_ChannelInvideoPromotionDefaultTiming *defaultTiming; 19 | @property (strong, nonatomic) MABYT3_ChannelInvideoPromotionPosition *position; 20 | @property (strong, nonatomic) NSMutableArray *items; 21 | 22 | - (id) initFromDictionary:(NSDictionary *)dict; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/InVideoPromotion/MABYT3_ChannelInvideoPromotion.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelInvideoPromotion.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#invideoPromotion 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelInvideoPromotion.h" 12 | 13 | @implementation MABYT3_ChannelInvideoPromotion 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _defaultTiming = [[MABYT3_ChannelInvideoPromotionDefaultTiming alloc] init]; 20 | _position = [[MABYT3_ChannelInvideoPromotionPosition alloc] init]; 21 | _items = [[NSMutableArray alloc] init]; 22 | } 23 | return self; 24 | } 25 | 26 | - (id) initFromDictionary:(NSDictionary *)dict { 27 | 28 | self = [super init]; 29 | if (self) { 30 | _defaultTiming = [[MABYT3_ChannelInvideoPromotionDefaultTiming alloc] init]; 31 | _position = [[MABYT3_ChannelInvideoPromotionPosition alloc] init]; 32 | _items = [[NSMutableArray alloc] init]; 33 | 34 | if ([dict objectForKey:@"defaultTiming"]) { 35 | _defaultTiming = [[MABYT3_ChannelInvideoPromotionDefaultTiming alloc] initFromDictionary:[dict objectForKey:@"defaultTiming"]]; 36 | } 37 | if ([dict objectForKey:@"position"]) { 38 | _position = [[MABYT3_ChannelInvideoPromotionPosition alloc] initFromDictionary:[dict objectForKey:@"position"]]; 39 | } 40 | if ([dict objectForKey:@"items"]) { 41 | NSArray *values = [dict objectForKey:@"items"]; 42 | for (int i = 0; i < values.count; i++) { 43 | MABYT3_ChannelInvideoPromotionItem *itm = [[MABYT3_ChannelInvideoPromotionItem alloc] initFromDictionary:values[i]]; 44 | [_items addObject:itm]; 45 | } 46 | } 47 | } 48 | return self; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/InVideoPromotion/MABYT3_ChannelInvideoPromotionDefaultTiming.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelInvideoPromotionDefaultTiming.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MABYT3_enums.h" 11 | 12 | @interface MABYT3_ChannelInvideoPromotionDefaultTiming : NSObject 13 | 14 | @property (nonatomic) YTInVideoPromotionType type; 15 | @property (nonatomic) unsigned long offsetMs; 16 | @property (nonatomic) unsigned long durationMs; 17 | 18 | - (id) initFromDictionary:(NSDictionary *)dict; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/InVideoPromotion/MABYT3_ChannelInvideoPromotionDefaultTiming.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelInvideoPromotionDefaultTiming.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_ChannelInvideoPromotionDefaultTiming.h" 10 | 11 | @implementation MABYT3_ChannelInvideoPromotionDefaultTiming 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _type = kYTInVideoPromotionTypeStart; 18 | _offsetMs = 0; 19 | _durationMs = 0; 20 | } 21 | return self; 22 | } 23 | 24 | - (id) initFromDictionary:(NSDictionary *)dict { 25 | 26 | self = [super init]; 27 | if (self) { 28 | _type = kYTInVideoPromotionTypeStart; 29 | _offsetMs = 0; 30 | _durationMs = 0; 31 | if ([dict objectForKey:@"type"]) { 32 | _type = [self promotionTypeFromString:[dict objectForKey:@"type"]]; 33 | } 34 | if ([dict objectForKey:@"offsetMs"]) { 35 | _offsetMs = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"offsetMs"]] unsignedLongValue]; 36 | } 37 | if ([dict objectForKey:@"durationMs"]) { 38 | _durationMs = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"durationMs"]] unsignedLongValue]; 39 | } 40 | 41 | } 42 | return self; 43 | } 44 | 45 | - (YTInVideoPromotionType) promotionTypeFromString:(NSString *)proString { 46 | 47 | YTInVideoPromotionType retVal = kYTInVideoPromotionTypeStart; 48 | 49 | if ([proString isEqualToString:@"offsetFromEnd"]) { 50 | retVal = kYTInVideoPromotionTypeEnd; 51 | } 52 | return retVal; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/InVideoPromotion/MABYT3_ChannelInvideoPromotionItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelInvideoPromotionItem.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MABYT3_ChannelInvideoPromotionItemIdentifier.h" 11 | #import "MABYT3_ChannelInvideoPromotionPosition.h" 12 | 13 | @interface MABYT3_ChannelInvideoPromotionItem : NSObject 14 | 15 | @property (strong, nonatomic) MABYT3_ChannelInvideoPromotionItemIdentifier *identifier; 16 | @property (strong, nonatomic) MABYT3_ChannelInvideoPromotionPosition *timing; 17 | @property (strong, nonatomic) NSString *customMessage; 18 | @property (nonatomic) BOOL promotedByContentOwner; 19 | 20 | - (id) initFromDictionary:(NSDictionary *)dict; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/InVideoPromotion/MABYT3_ChannelInvideoPromotionItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelInvideoPromotionItem.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_ChannelInvideoPromotionItem.h" 10 | 11 | @implementation MABYT3_ChannelInvideoPromotionItem 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _identifier = [[MABYT3_ChannelInvideoPromotionItemIdentifier alloc] init]; 18 | _timing = [[MABYT3_ChannelInvideoPromotionPosition alloc] init]; 19 | _customMessage = @""; 20 | _promotedByContentOwner = NO; 21 | } 22 | return self; 23 | } 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict { 26 | 27 | self = [super init]; 28 | if (self) { 29 | _identifier = [[MABYT3_ChannelInvideoPromotionItemIdentifier alloc] init]; 30 | _timing = [[MABYT3_ChannelInvideoPromotionPosition alloc] init]; 31 | _customMessage = @""; 32 | _promotedByContentOwner = NO; 33 | 34 | if ([dict objectForKey:@"id"]) { 35 | _identifier = [[MABYT3_ChannelInvideoPromotionItemIdentifier alloc] initFromDictionary:[dict objectForKey:@"id"]]; 36 | } 37 | if ([dict objectForKey:@"timing"]) { 38 | _timing = [[MABYT3_ChannelInvideoPromotionPosition alloc] initFromDictionary:[dict objectForKey:@"timing"]]; 39 | } 40 | if ([dict objectForKey:@"customMessage"]) { 41 | _customMessage = [dict objectForKey:@"customMessage"]; 42 | } 43 | if ([dict objectForKey:@"promotedByContentOwner"]) { 44 | if ([[dict objectForKey:@"promotedByContentOwner"] integerValue] > 0) { 45 | _promotedByContentOwner = YES; 46 | } 47 | } 48 | } 49 | return self; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/InVideoPromotion/MABYT3_ChannelInvideoPromotionItemIdentifier.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelInvideoPromotionItemIdentifier.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MABYT3_enums.h" 11 | 12 | @interface MABYT3_ChannelInvideoPromotionItemIdentifier : NSObject 13 | 14 | @property (nonatomic) YTPromotedResourceType type; 15 | @property (strong, nonatomic) NSString *videoId; 16 | @property (strong, nonatomic) NSString *websiteUrl; 17 | @property (strong, nonatomic) NSString *recentlyUploadedBy; 18 | 19 | - (id) initFromDictionary:(NSDictionary *)dict; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/InVideoPromotion/MABYT3_ChannelInvideoPromotionItemIdentifier.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelInvideoPromotionItemIdentifier.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_ChannelInvideoPromotionItemIdentifier.h" 10 | 11 | @implementation MABYT3_ChannelInvideoPromotionItemIdentifier 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _type = kYTPromotedResourceTypeVideo; 18 | _videoId = @""; 19 | _websiteUrl = @""; 20 | _recentlyUploadedBy = @""; 21 | } 22 | return self; 23 | } 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict { 26 | 27 | self = [super init]; 28 | if (self) { 29 | _type = kYTPromotedResourceTypeVideo; 30 | _videoId = @""; 31 | _websiteUrl = @""; 32 | _recentlyUploadedBy = @""; 33 | 34 | if ([dict objectForKey:@"type"]) { 35 | _type = [self resourceTypeFromString:[dict objectForKey:@"type"]]; 36 | } 37 | if ([dict objectForKey:@"videoId"]) { 38 | _videoId = [dict objectForKey:@"videoId"]; 39 | } 40 | if ([dict objectForKey:@"websiteUrl"]) { 41 | _websiteUrl = [dict objectForKey:@"websiteUrl"]; 42 | } 43 | if ([dict objectForKey:@"recentlyUploadedBy"]) { 44 | _recentlyUploadedBy = [dict objectForKey:@"recentlyUploadedBy"]; 45 | } 46 | } 47 | return self; 48 | } 49 | 50 | - (YTPromotedResourceType) resourceTypeFromString:(NSString *)resString { 51 | 52 | YTPromotedResourceType retVal = kYTPromotedResourceTypeVideo; 53 | 54 | if ([resString isEqualToString:@"recentUpload"]) { 55 | retVal = kYTPromotedResourceTypeRecentUpload; 56 | } 57 | else if ([resString isEqualToString:@"website"]) { 58 | retVal = kYTPromotedResourceTypeWebsite; 59 | } 60 | return retVal; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/InVideoPromotion/MABYT3_ChannelInvideoPromotionPosition.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelBrandingSettingsInvideoPromotionPosition.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MABYT3_enums.h" 11 | 12 | @interface MABYT3_ChannelInvideoPromotionPosition : NSObject 13 | 14 | @property (nonatomic) YTInVideoPromotionPositionType type; 15 | @property (nonatomic) YTInVideoPromotionCornerPosition cornerPosition; 16 | 17 | - (id) initFromDictionary:(NSDictionary *)dict; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/InVideoPromotion/MABYT3_ChannelInvideoPromotionPosition.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelBrandingSettingsInvideoPromotionPosition.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_ChannelInvideoPromotionPosition.h" 10 | 11 | @implementation MABYT3_ChannelInvideoPromotionPosition 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _type = kYTInVideoPromotionPositionTypeCorner; 18 | _cornerPosition = kYTInVideoPromotionCornerPositionbottomLeft; 19 | } 20 | return self; 21 | } 22 | 23 | - (id) initFromDictionary:(NSDictionary *)dict { 24 | 25 | self = [super init]; 26 | if (self) { 27 | _type = kYTInVideoPromotionPositionTypeCorner; 28 | _cornerPosition = kYTInVideoPromotionCornerPositionbottomLeft; 29 | if ([dict objectForKey:@"cornerPosition"]) { 30 | _cornerPosition = [self cornerPositionFromString:[dict objectForKey:@"cornerPosition"]]; 31 | } 32 | 33 | } 34 | return self; 35 | } 36 | 37 | - (YTInVideoPromotionCornerPosition) cornerPositionFromString:(NSString *)crnrString { 38 | 39 | YTInVideoPromotionCornerPosition retVal = kYTInVideoPromotionCornerPositionbottomLeft; 40 | 41 | if ([crnrString isEqualToString:@"bottomRight"]) { 42 | retVal = kYTInVideoPromotionCornerPositionbottomRight; 43 | } 44 | else if ([crnrString isEqualToString:@"topLeft"]) { 45 | retVal = kYTInVideoPromotionCornerPositiontopLeft; 46 | } 47 | else if ([crnrString isEqualToString:@"topRight"]) { 48 | retVal = kYTInVideoPromotionCornerPositiontopRight; 49 | } 50 | return retVal; 51 | } 52 | 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_Channel.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Channel.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#properties 6 | // 7 | // Created by Muhammad Bassio on 4/30/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_ChannelSnippet.h" 13 | #import "MABYT3_ChannelContentDetails.h" 14 | #import "MABYT3_ChannelStatistics.h" 15 | #import "MABYT3_ChannelStatus.h" 16 | #import "MABYT3_ChannelInvideoPromotion.h" 17 | #import "MABYT3_ChannelAuditDetails.h" 18 | #import "MABYT3_ChannelContentOwnerDetails.h" 19 | 20 | @interface MABYT3_Channel : NSObject 21 | 22 | @property (strong, nonatomic) NSString *kind; 23 | @property (strong, nonatomic) NSString *etag; 24 | @property (strong, nonatomic) NSString *identifier; 25 | @property (strong, nonatomic, readonly) MABYT3_ChannelSnippet *snippet; 26 | @property (strong, nonatomic, readonly) MABYT3_ChannelContentDetails *contentDetails; 27 | @property (strong, nonatomic, readonly) MABYT3_ChannelStatistics *statistics; 28 | @property (strong, nonatomic, readonly) MABYT3_ChannelStatus *status; 29 | @property (strong, nonatomic) MABYT3_ChannelInvideoPromotion *invideoPromotion; 30 | @property (strong, nonatomic) MABYT3_ChannelAuditDetails *auditDetails; 31 | @property (strong, nonatomic) MABYT3_ChannelContentOwnerDetails *contentOwnerDetails; 32 | 33 | - (id) initFromDictionary:(NSDictionary *)dict; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_Channel.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Channel.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#properties 6 | // 7 | // Created by Muhammad Bassio on 4/30/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_Channel.h" 12 | 13 | @implementation MABYT3_Channel 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#channel"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _snippet = [[MABYT3_ChannelSnippet alloc] init]; 23 | _contentDetails = [[MABYT3_ChannelContentDetails alloc] init]; 24 | _statistics = [[MABYT3_ChannelStatistics alloc] init]; 25 | _status = [[MABYT3_ChannelStatus alloc] init]; 26 | _invideoPromotion = [[MABYT3_ChannelInvideoPromotion alloc] init]; 27 | _auditDetails = [[MABYT3_ChannelAuditDetails alloc] init]; 28 | _contentOwnerDetails = [[MABYT3_ChannelContentOwnerDetails alloc] init]; 29 | } 30 | return self; 31 | } 32 | 33 | - (id) initFromDictionary:(NSDictionary *)dict { 34 | 35 | self = [super init]; 36 | if (self) { 37 | _kind = @"youtube#channel"; 38 | _etag = @""; 39 | _identifier = @""; 40 | _snippet = [[MABYT3_ChannelSnippet alloc] init]; 41 | _contentDetails = [[MABYT3_ChannelContentDetails alloc] init]; 42 | _statistics = [[MABYT3_ChannelStatistics alloc] init]; 43 | _status = [[MABYT3_ChannelStatus alloc] init]; 44 | _invideoPromotion = [[MABYT3_ChannelInvideoPromotion alloc] init]; 45 | _auditDetails = [[MABYT3_ChannelAuditDetails alloc] init]; 46 | _contentOwnerDetails = [[MABYT3_ChannelContentOwnerDetails alloc] init]; 47 | 48 | if ([dict objectForKey:@"kind"]) { 49 | _kind = [dict objectForKey:@"kind"]; 50 | } 51 | if ([dict objectForKey:@"etag"]) { 52 | _etag = [dict objectForKey:@"etag"]; 53 | } 54 | if ([dict objectForKey:@"id"]) { 55 | _identifier = [dict objectForKey:@"id"]; 56 | } 57 | if ([dict objectForKey:@"snippet"]) { 58 | _snippet = [[MABYT3_ChannelSnippet alloc] initFromDictionary:[dict objectForKey:@"snippet"]]; 59 | } 60 | if ([dict objectForKey:@"contentDetails"]) { 61 | _contentDetails = [[MABYT3_ChannelContentDetails alloc] initFromDictionary:[dict objectForKey:@"contentDetails"]]; 62 | } 63 | if ([dict objectForKey:@"statistics"]) { 64 | _statistics = [[MABYT3_ChannelStatistics alloc] initFromDictionary:[dict objectForKey:@"statistics"]]; 65 | } 66 | if ([dict objectForKey:@"status"]) { 67 | _status = [[MABYT3_ChannelStatus alloc] initFromDictionary:[dict objectForKey:@"status"]]; 68 | } 69 | if ([dict objectForKey:@"invideoPromotion"]) { 70 | _invideoPromotion = [[MABYT3_ChannelInvideoPromotion alloc] initFromDictionary:[dict objectForKey:@"invideoPromotion"]]; 71 | } 72 | if ([dict objectForKey:@"auditDetails"]) { 73 | _auditDetails = [[MABYT3_ChannelAuditDetails alloc] initFromDictionary:[dict objectForKey:@"auditDetails"]]; 74 | } 75 | if ([dict objectForKey:@"contentOwnerDetails"]) { 76 | _contentOwnerDetails = [[MABYT3_ChannelContentOwnerDetails alloc] initFromDictionary:[dict objectForKey:@"contentOwnerDetails"]]; 77 | } 78 | } 79 | return self; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelAuditDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelAuditDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#auditDetails 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_ChannelAuditDetails : NSObject 14 | 15 | @property (nonatomic) BOOL overallGoodStanding; 16 | @property (nonatomic) BOOL communityGuidelinesGoodStanding; 17 | @property (nonatomic) BOOL copyrightStrikesGoodStanding; 18 | @property (nonatomic) BOOL contentIdClaimsGoodStanding; 19 | 20 | - (id) initFromDictionary:(NSDictionary *)dict; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelAuditDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelAuditDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#auditDetails 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelAuditDetails.h" 12 | 13 | @implementation MABYT3_ChannelAuditDetails 14 | 15 | 16 | - (id) init { 17 | 18 | self = [super init]; 19 | if (self) { 20 | _overallGoodStanding = YES; 21 | _communityGuidelinesGoodStanding = YES; 22 | _copyrightStrikesGoodStanding = YES; 23 | _contentIdClaimsGoodStanding = YES; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _overallGoodStanding = YES; 33 | _communityGuidelinesGoodStanding = YES; 34 | _copyrightStrikesGoodStanding = YES; 35 | _contentIdClaimsGoodStanding = YES; 36 | 37 | if ([dict objectForKey:@"overallGoodStanding"]) { 38 | if ([[dict objectForKey:@"overallGoodStanding"] integerValue] == 0) { 39 | _overallGoodStanding = NO; 40 | } 41 | } 42 | if ([dict objectForKey:@"communityGuidelinesGoodStanding"]) { 43 | if ([[dict objectForKey:@"communityGuidelinesGoodStanding"] integerValue] == 0) { 44 | _communityGuidelinesGoodStanding = NO; 45 | } 46 | } 47 | if ([dict objectForKey:@"copyrightStrikesGoodStanding"]) { 48 | if ([[dict objectForKey:@"copyrightStrikesGoodStanding"] integerValue] == 0) { 49 | _copyrightStrikesGoodStanding = NO; 50 | } 51 | } 52 | if ([dict objectForKey:@"contentIdClaimsGoodStanding"]) { 53 | if ([[dict objectForKey:@"contentIdClaimsGoodStanding"] integerValue] == 0) { 54 | _contentIdClaimsGoodStanding = NO; 55 | } 56 | } 57 | 58 | } 59 | return self; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelContentDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelContentDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#contentDetails 6 | // 7 | // Created by Muhammad Bassio on 4/30/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_ChannelContentDetails : NSObject 14 | 15 | @property (strong, nonatomic) NSString *googlePlusUserId; 16 | @property (strong, nonatomic) NSMutableDictionary *relatedPlaylists; 17 | 18 | - (id) initFromDictionary:(NSDictionary *)dict; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelContentDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelContentDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#contentDetails 6 | // 7 | // Created by Muhammad Bassio on 4/30/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelContentDetails.h" 12 | 13 | @implementation MABYT3_ChannelContentDetails 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _googlePlusUserId = @""; 20 | _relatedPlaylists = [[NSMutableDictionary alloc] init]; 21 | } 22 | return self; 23 | } 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict { 26 | 27 | self = [super init]; 28 | if (self) { 29 | _googlePlusUserId = @""; 30 | _relatedPlaylists = [[NSMutableDictionary alloc] init]; 31 | if ([dict objectForKey:@"relatedPlaylists"]) { 32 | _relatedPlaylists = [dict objectForKey:@"relatedPlaylists"]; 33 | } 34 | if ([dict objectForKey:@"googlePlusUserId"]) { 35 | _googlePlusUserId = [dict objectForKey:@"googlePlusUserId"]; 36 | } 37 | } 38 | return self; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelContentOwnerDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelContentOwnerDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#contentOwnerDetails 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MAB_GDate.h" 13 | 14 | @interface MABYT3_ChannelContentOwnerDetails : NSObject 15 | 16 | @property (strong, nonatomic) NSString *contentOwner; 17 | @property (strong, nonatomic) MAB_GDate *timeLinked; 18 | 19 | - (id) initFromDictionary:(NSDictionary *)dict; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelContentOwnerDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelContentOwnerDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#contentOwnerDetails 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelContentOwnerDetails.h" 12 | 13 | @implementation MABYT3_ChannelContentOwnerDetails 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _contentOwner = @""; 20 | _timeLinked = [[MAB_GDate alloc] init]; 21 | } 22 | return self; 23 | } 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict { 26 | 27 | self = [super init]; 28 | if (self) { 29 | _contentOwner = @""; 30 | _timeLinked = [[MAB_GDate alloc] init]; 31 | 32 | if ([dict objectForKey:@"contentOwner"]) { 33 | _contentOwner = [dict objectForKey:@"contentOwner"]; 34 | } 35 | if ([dict objectForKey:@"timeLinked"]) { 36 | _timeLinked = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"timeLinked"]]; 37 | } 38 | } 39 | return self; 40 | } 41 | 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelSnippet.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelSnippet.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#snippet 6 | // 7 | // Created by Muhammad Bassio on 4/30/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MAB_GDate.h" 13 | #import "MABYT3_Thumbnail.h" 14 | 15 | @interface MABYT3_ChannelSnippet : NSObject 16 | 17 | @property (strong, nonatomic) NSString *title; 18 | @property (strong, nonatomic) NSString *description; 19 | @property (strong, nonatomic) MAB_GDate *publishedAt; 20 | @property (strong, nonatomic) NSMutableDictionary *thumbnails; 21 | 22 | - (id) initFromDictionary:(NSDictionary *)dict; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelSnippet.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelSnippet.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#snippet 6 | // 7 | // Created by Muhammad Bassio on 4/30/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelSnippet.h" 12 | 13 | @implementation MABYT3_ChannelSnippet 14 | 15 | @synthesize description = _description; 16 | 17 | - (id) init { 18 | 19 | self = [super init]; 20 | if (self) { 21 | _title = @""; 22 | _description = @""; 23 | _publishedAt = [[MAB_GDate alloc] init]; 24 | _thumbnails = [[NSMutableDictionary alloc] init]; 25 | } 26 | return self; 27 | } 28 | 29 | - (id) initFromDictionary:(NSDictionary *)dict { 30 | 31 | self = [super init]; 32 | if (self) { 33 | _title = @""; 34 | _description = @""; 35 | _publishedAt = [[MAB_GDate alloc] init]; 36 | _thumbnails = [[NSMutableDictionary alloc] init]; 37 | 38 | if ([dict objectForKey:@"title"]) { 39 | _title = [dict objectForKey:@"title"]; 40 | } 41 | if ([dict objectForKey:@"description"]) { 42 | _description = [dict objectForKey:@"description"]; 43 | } 44 | if ([dict objectForKey:@"publishedAt"]) { 45 | _publishedAt = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"publishedAt"]]; 46 | } 47 | if ([dict objectForKey:@"thumbnails"]) { 48 | NSDictionary *thmbDict = [dict objectForKey:@"thumbnails"]; 49 | NSArray *keys = [thmbDict allKeys]; 50 | for (int i = 0; i < keys.count; i++) { 51 | MABYT3_Thumbnail *thmb = [[MABYT3_Thumbnail alloc] initFromDictionary:[thmbDict objectForKey:keys[i]]]; 52 | [_thumbnails setObject:thmb forKey:keys[i]]; 53 | } 54 | } 55 | } 56 | return self; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelStatistics.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelStatistics.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#statistics 6 | // 7 | // Created by Muhammad Bassio on 4/30/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_ChannelStatistics : NSObject 14 | 15 | @property (nonatomic) unsigned long viewCount; 16 | @property (nonatomic) unsigned long commentCount; 17 | @property (nonatomic) unsigned long subscriberCount; 18 | @property (nonatomic) BOOL hiddenSubscriberCount; 19 | @property (nonatomic) unsigned long videoCount; 20 | 21 | - (id) initFromDictionary:(NSDictionary *)dict; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelStatistics.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelStatistics.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#statistics 6 | // 7 | // Created by Muhammad Bassio on 4/30/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelStatistics.h" 12 | 13 | @implementation MABYT3_ChannelStatistics 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _viewCount = 0; 20 | _commentCount = 0; 21 | _subscriberCount = 0; 22 | _videoCount = 0; 23 | _hiddenSubscriberCount = NO; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _viewCount = 0; 33 | _commentCount = 0; 34 | _subscriberCount = 0; 35 | _videoCount = 0; 36 | _hiddenSubscriberCount = NO; 37 | if ([dict objectForKey:@"viewCount"]) { 38 | _viewCount = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"viewCount"]] unsignedLongValue]; 39 | } 40 | if ([dict objectForKey:@"commentCount"]) { 41 | _commentCount = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"commentCount"]] unsignedLongValue]; 42 | } 43 | if ([dict objectForKey:@"subscriberCount"]) { 44 | _subscriberCount = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"subscriberCount"]] unsignedLongValue]; 45 | } 46 | if ([dict objectForKey:@"videoCount"]) { 47 | _videoCount = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"videoCount"]] unsignedLongValue]; 48 | } 49 | if ([dict objectForKey:@"hiddenSubscriberCount"]) { 50 | if ([[dict objectForKey:@"hiddenSubscriberCount"] integerValue] > 0) { 51 | _hiddenSubscriberCount = YES; 52 | } 53 | } 54 | } 55 | return self; 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelStatus.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelStatus.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#status 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_enums.h" 13 | 14 | @interface MABYT3_ChannelStatus : NSObject 15 | 16 | @property (nonatomic) YTPrivacyStatus privacyStatus; 17 | @property (nonatomic) BOOL isLinked; 18 | 19 | - (id) initFromDictionary:(NSDictionary *)dict; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /YTAPI3/API/Channel/MABYT3_ChannelStatus.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelStatus.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channels#status 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelStatus.h" 12 | 13 | @implementation MABYT3_ChannelStatus 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _privacyStatus = kYTPrivacyStatusPublic; 20 | _isLinked = NO; 21 | } 22 | return self; 23 | } 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict { 26 | 27 | self = [super init]; 28 | if (self) { 29 | _privacyStatus = kYTPrivacyStatusPublic; 30 | _isLinked = NO; 31 | if ([dict objectForKey:@"privacyStatus"]) { 32 | _privacyStatus = [self privacyStatusFromString:[dict objectForKey:@"privacyStatus"]]; 33 | } 34 | if ([dict objectForKey:@"isLinked"]) { 35 | if ([[dict objectForKey:@"isLinked"] integerValue] > 0) { 36 | _isLinked = YES; 37 | } 38 | } 39 | } 40 | return self; 41 | } 42 | 43 | - (YTPrivacyStatus) privacyStatusFromString:(NSString *)prvString { 44 | 45 | YTPrivacyStatus retVal = kYTPrivacyStatusPublic; 46 | 47 | if ([prvString isEqualToString:@"private"]) { 48 | retVal = kYTPrivacyStatusPrivate; 49 | } 50 | else if ([prvString isEqualToString:@"unlisted"]) { 51 | retVal = kYTPrivacyStatusUnlisted; 52 | } 53 | return retVal; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /YTAPI3/API/ChannelSection/MABYT3_ChannelSection.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelSection.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channelSections#properties 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_ChannelSectionSnippet.h" 13 | #import "MABYT3_ChannelSectionContentDetails.h" 14 | 15 | 16 | @interface MABYT3_ChannelSection : NSObject 17 | 18 | @property (strong, nonatomic) NSString *kind; 19 | @property (strong, nonatomic) NSString *etag; 20 | @property (strong, nonatomic) NSString *identifier; 21 | @property (strong, nonatomic, readonly) MABYT3_ChannelSectionSnippet *snippet; 22 | @property (strong, nonatomic, readonly) MABYT3_ChannelSectionContentDetails *contentDetails; 23 | 24 | - (id) initFromDictionary:(NSDictionary *)dict; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /YTAPI3/API/ChannelSection/MABYT3_ChannelSection.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelSection.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channelSections#properties 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelSection.h" 12 | 13 | @implementation MABYT3_ChannelSection 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#channelSection"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _snippet = [[MABYT3_ChannelSectionSnippet alloc] init]; 23 | _contentDetails = [[MABYT3_ChannelSectionContentDetails alloc] init]; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _kind = @"youtube#channelSection"; 33 | _etag = @""; 34 | _identifier = @""; 35 | _snippet = [[MABYT3_ChannelSectionSnippet alloc] init]; 36 | _contentDetails = [[MABYT3_ChannelSectionContentDetails alloc] init]; 37 | 38 | if ([dict objectForKey:@"kind"]) { 39 | _kind = [dict objectForKey:@"kind"]; 40 | } 41 | if ([dict objectForKey:@"etag"]) { 42 | _etag = [dict objectForKey:@"etag"]; 43 | } 44 | if ([dict objectForKey:@"id"]) { 45 | _identifier = [dict objectForKey:@"id"]; 46 | } 47 | if ([dict objectForKey:@"snippet"]) { 48 | _snippet = [[MABYT3_ChannelSectionSnippet alloc] initFromDictionary:[dict objectForKey:@"snippet"]]; 49 | } 50 | if ([dict objectForKey:@"contentDetails"]) { 51 | _contentDetails = [[MABYT3_ChannelSectionContentDetails alloc] initFromDictionary:[dict objectForKey:@"contentDetails"]]; 52 | } 53 | } 54 | return self; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /YTAPI3/API/ChannelSection/MABYT3_ChannelSectionContentDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelSectionContentDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channelSections#contentDetails 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_ChannelSectionContentDetails : NSObject 14 | 15 | @property (strong, nonatomic) NSMutableArray *playlists; 16 | @property (strong, nonatomic) NSMutableArray *channels; 17 | 18 | - (id) initFromDictionary:(NSDictionary *)dict; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /YTAPI3/API/ChannelSection/MABYT3_ChannelSectionContentDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelSectionContentDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channelSections#contentDetails 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelSectionContentDetails.h" 12 | 13 | @implementation MABYT3_ChannelSectionContentDetails 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _channels = [[NSMutableArray alloc] init]; 20 | _playlists = [[NSMutableArray alloc] init]; 21 | } 22 | return self; 23 | } 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict { 26 | 27 | self = [super init]; 28 | if (self) { 29 | _channels = [[NSMutableArray alloc] init]; 30 | _playlists = [[NSMutableArray alloc] init]; 31 | 32 | if ([dict objectForKey:@"playlists"]) { 33 | _playlists = [[dict objectForKey:@"playlists"] mutableCopy]; 34 | } 35 | if ([dict objectForKey:@"channels"]) { 36 | _channels = [[dict objectForKey:@"channels"] mutableCopy]; 37 | } 38 | } 39 | return self; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /YTAPI3/API/ChannelSection/MABYT3_ChannelSectionSnippet.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelSectionSnippet.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channelSections#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_enums.h" 13 | 14 | @interface MABYT3_ChannelSectionSnippet : NSObject 15 | 16 | @property (nonatomic) YTChannelSectioType type; 17 | @property (nonatomic) YTChannelSectioStyle style; 18 | @property (strong, nonatomic) NSString *channelId; 19 | @property (strong, nonatomic) NSString *title; 20 | @property (nonatomic) unsigned long position; 21 | 22 | - (id) initFromDictionary:(NSDictionary *)dict; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /YTAPI3/API/ChannelSection/MABYT3_ChannelSectionSnippet.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ChannelSectionSnippet.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/channelSections#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_ChannelSectionSnippet.h" 12 | 13 | @implementation MABYT3_ChannelSectionSnippet 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _type = kYTChannelSectioTypeAllPlaylists; 20 | _style = kYTChannelSectioStyleHorizontalRow; 21 | _channelId = @""; 22 | _title = @""; 23 | _position = 0; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _type = kYTChannelSectioTypeAllPlaylists; 33 | _style = kYTChannelSectioStyleHorizontalRow; 34 | _channelId = @""; 35 | _title = @""; 36 | _position = 0; 37 | 38 | if ([dict objectForKey:@"channelId"]) { 39 | _channelId = [dict objectForKey:@"channelId"]; 40 | } 41 | if ([dict objectForKey:@"title"]) { 42 | _title = [dict objectForKey:@"title"]; 43 | } 44 | if ([dict objectForKey:@"position"]) { 45 | _position = [[dict objectForKey:@"position"] unsignedLongValue]; 46 | } 47 | if ([dict objectForKey:@"style"]) { 48 | _style = [self sectionStyleFromString:[dict objectForKey:@"style"]]; 49 | } 50 | if ([dict objectForKey:@"type"]) { 51 | _type = [self sectionTypeFromString:[dict objectForKey:@"type"]]; 52 | } 53 | } 54 | return self; 55 | } 56 | 57 | - (YTChannelSectioStyle) sectionStyleFromString:(NSString *)stlString { 58 | 59 | YTChannelSectioStyle retVal = kYTChannelSectioStyleHorizontalRow; 60 | 61 | if ([stlString isEqualToString:@"verticalList"]) { 62 | retVal = kYTChannelSectioStyleVerticalList; 63 | } 64 | return retVal; 65 | } 66 | 67 | - (YTChannelSectioType) sectionTypeFromString:(NSString *)typString { 68 | 69 | YTChannelSectioType retVal = kYTChannelSectioTypeAllPlaylists; 70 | 71 | if ([typString isEqualToString:@"completedEvents"]) { 72 | retVal = kYTChannelSectioTypeCompletedEvents; 73 | } 74 | if ([typString isEqualToString:@"likedPlaylists"]) { 75 | retVal = kYTChannelSectioTypeLikedPlaylists; 76 | } 77 | if ([typString isEqualToString:@"likes"]) { 78 | retVal = kYTChannelSectioTypeLikes; 79 | } 80 | if ([typString isEqualToString:@"liveEvents"]) { 81 | retVal = kYTChannelSectioTypeLiveEvents; 82 | } 83 | if ([typString isEqualToString:@"multipleChannels"]) { 84 | retVal = kYTChannelSectioTypeMultipleChannels; 85 | } 86 | if ([typString isEqualToString:@"multiplePlaylists"]) { 87 | retVal = kYTChannelSectioTypeMultiplePlaylists; 88 | } 89 | if ([typString isEqualToString:@"popularUploads"]) { 90 | retVal = kYTChannelSectioTypePopularUploads; 91 | } 92 | if ([typString isEqualToString:@"recentActivity"]) { 93 | retVal = kYTChannelSectioTypeRecentActivity; 94 | } 95 | if ([typString isEqualToString:@"recentPosts"]) { 96 | retVal = kYTChannelSectioTypeRecentPosts; 97 | } 98 | if ([typString isEqualToString:@"recentUploads"]) { 99 | retVal = kYTChannelSectioTypeRecentUploads; 100 | } 101 | if ([typString isEqualToString:@"singlePlaylist"]) { 102 | retVal = kYTChannelSectioTypeSinglePlaylist; 103 | } 104 | if ([typString isEqualToString:@"upcomingEvents"]) { 105 | retVal = kYTChannelSectioTypeUpcomingEvents; 106 | } 107 | return retVal; 108 | } 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_ContentRating.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ContentRating.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_ContentRating : NSObject 12 | 13 | @property (strong, nonatomic) NSString *mpaaRating; 14 | @property (strong, nonatomic) NSString *tvpgRating; 15 | @property (strong, nonatomic) NSString *bbfcRating; 16 | @property (strong, nonatomic) NSString *chvrsRating; 17 | @property (strong, nonatomic) NSString *eirinRating; 18 | @property (strong, nonatomic) NSString *cbfcRating; 19 | @property (strong, nonatomic) NSString *fmocRating; 20 | @property (strong, nonatomic) NSString *icaaRating; 21 | @property (strong, nonatomic) NSString *acbRating; 22 | @property (strong, nonatomic) NSString *oflcRating; 23 | @property (strong, nonatomic) NSString *fskRating; 24 | @property (strong, nonatomic) NSString *kmrbRating; 25 | @property (strong, nonatomic) NSString *djctqRating; 26 | @property (strong, nonatomic) NSString *russiaRating; 27 | @property (strong, nonatomic) NSString *rtcRating; 28 | @property (strong, nonatomic) NSString *ytRating; 29 | @property (strong, nonatomic) NSString *mibacRating; 30 | @property (strong, nonatomic) NSString *catvRating; 31 | @property (strong, nonatomic) NSString *catvfrRating; 32 | 33 | - (id) initFromDictionary:(NSDictionary *)dict; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_ContentRating.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ContentRating.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_ContentRating.h" 10 | 11 | @implementation MABYT3_ContentRating 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _mpaaRating = @"mpaaUnrated"; 18 | _tvpgRating = @"tvpgUnrated"; 19 | _bbfcRating = @"bbfcUnrated"; 20 | _chvrsRating = @"chvrsUnrated"; 21 | _eirinRating = @"eirinUnrated"; 22 | _cbfcRating = @"cbfcUnrated"; 23 | _fmocRating = @"fmocUnrated"; 24 | _icaaRating = @"icaaUnrated"; 25 | _acbRating = @"acbUnrated"; 26 | _oflcRating = @"oflcUnrated"; 27 | _fskRating = @"fskUnrated"; 28 | _kmrbRating = @"kmrbUnrated"; 29 | _djctqRating = @"djctqUnrated"; 30 | _russiaRating = @"russiaUnrated"; 31 | _rtcRating = @"rtcUnrated"; 32 | _ytRating = @""; 33 | _mibacRating = @"mibacUnrated"; 34 | _catvRating = @"catvUnrated"; 35 | _catvfrRating = @"catvfrUnrated"; 36 | } 37 | return self; 38 | } 39 | 40 | - (id) initFromDictionary:(NSDictionary *)dict { 41 | 42 | self = [super init]; 43 | if (self) { 44 | _mpaaRating = @"mpaaUnrated"; 45 | _tvpgRating = @"tvpgUnrated"; 46 | _bbfcRating = @"bbfcUnrated"; 47 | _chvrsRating = @"chvrsUnrated"; 48 | _eirinRating = @"eirinUnrated"; 49 | _cbfcRating = @"cbfcUnrated"; 50 | _fmocRating = @"fmocUnrated"; 51 | _icaaRating = @"icaaUnrated"; 52 | _acbRating = @"acbUnrated"; 53 | _oflcRating = @"oflcUnrated"; 54 | _fskRating = @"fskUnrated"; 55 | _kmrbRating = @"kmrbUnrated"; 56 | _djctqRating = @"djctqUnrated"; 57 | _russiaRating = @"russiaUnrated"; 58 | _rtcRating = @"rtcUnrated"; 59 | _ytRating = @""; 60 | _mibacRating = @"mibacUnrated"; 61 | _catvRating = @"catvUnrated"; 62 | _catvfrRating = @"catvfrUnrated"; 63 | 64 | if ([dict objectForKey:@"mpaaRating"]) { 65 | _mpaaRating = [dict objectForKey:@"mpaaRating"]; 66 | } 67 | if ([dict objectForKey:@"tvpgRating"]) { 68 | _tvpgRating = [dict objectForKey:@"tvpgRating"]; 69 | } 70 | if ([dict objectForKey:@"bbfcRating"]) { 71 | _bbfcRating = [dict objectForKey:@"bbfcRating"]; 72 | } 73 | if ([dict objectForKey:@"chvrsRating"]) { 74 | _chvrsRating = [dict objectForKey:@"chvrsRating"]; 75 | } 76 | if ([dict objectForKey:@"eirinRating"]) { 77 | _eirinRating = [dict objectForKey:@"eirinRating"]; 78 | } 79 | if ([dict objectForKey:@"cbfcRating"]) { 80 | _cbfcRating = [dict objectForKey:@"cbfcRating"]; 81 | } 82 | if ([dict objectForKey:@"fmocRating"]) { 83 | _fmocRating = [dict objectForKey:@"fmocRating"]; 84 | } 85 | if ([dict objectForKey:@"icaaRating"]) { 86 | _icaaRating = [dict objectForKey:@"icaaRating"]; 87 | } 88 | if ([dict objectForKey:@"acbRating"]) { 89 | _acbRating = [dict objectForKey:@"acbRating"]; 90 | } 91 | if ([dict objectForKey:@"oflcRating"]) { 92 | _oflcRating = [dict objectForKey:@"oflcRating"]; 93 | } 94 | if ([dict objectForKey:@"fskRating"]) { 95 | _fskRating = [dict objectForKey:@"fskRating"]; 96 | } 97 | if ([dict objectForKey:@"kmrbRating"]) { 98 | _kmrbRating = [dict objectForKey:@"kmrbRating"]; 99 | } 100 | if ([dict objectForKey:@"djctqRating"]) { 101 | _djctqRating = [dict objectForKey:@"djctqRating"]; 102 | } 103 | if ([dict objectForKey:@"russiaRating"]) { 104 | _russiaRating = [dict objectForKey:@"russiaRating"]; 105 | } 106 | if ([dict objectForKey:@"rtcRating"]) { 107 | _rtcRating = [dict objectForKey:@"rtcRating"]; 108 | } 109 | if ([dict objectForKey:@"ytRating"]) { 110 | _ytRating = [dict objectForKey:@"ytRating"]; 111 | } 112 | if ([dict objectForKey:@"mibacRating"]) { 113 | _mibacRating = [dict objectForKey:@"mibacRating"]; 114 | } 115 | if ([dict objectForKey:@"catvRating"]) { 116 | _catvRating = [dict objectForKey:@"catvRating"]; 117 | } 118 | if ([dict objectForKey:@"catvfrRating"]) { 119 | _catvfrRating = [dict objectForKey:@"catvfrRating"]; 120 | } 121 | 122 | } 123 | return self; 124 | } 125 | 126 | @end 127 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_GuideCategory.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_GuideCategory.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/guideCategories#properties 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_GuideCategory : NSObject 14 | 15 | @property (strong, nonatomic) NSString *kind; 16 | @property (strong, nonatomic) NSString *etag; 17 | @property (strong, nonatomic) NSString *identifier; 18 | @property (strong, nonatomic) NSString *channelId; 19 | @property (strong, nonatomic) NSString *title; 20 | 21 | - (id) initFromDictionary:(NSDictionary *)dict; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_GuideCategory.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_GuideCategory.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/guideCategories#properties 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_GuideCategory.h" 12 | 13 | @implementation MABYT3_GuideCategory 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#guideCategory"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _channelId = @""; 23 | _title = @""; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _kind = @"youtube#guideCategory"; 33 | _etag = @""; 34 | _identifier = @""; 35 | _channelId = @""; 36 | _title = @""; 37 | 38 | if ([dict objectForKey:@"kind"]) { 39 | _kind = [dict objectForKey:@"kind"]; 40 | } 41 | if ([dict objectForKey:@"etag"]) { 42 | _etag = [dict objectForKey:@"etag"]; 43 | } 44 | if ([dict objectForKey:@"id"]) { 45 | _identifier = [dict objectForKey:@"id"]; 46 | } 47 | if ([dict objectForKey:@"snippet"]) { 48 | NSDictionary *dict2 = [dict objectForKey:@"snippet"]; 49 | if ([dict2 objectForKey:@"title"]) { 50 | _title = [dict2 objectForKey:@"title"]; 51 | } 52 | if ([dict2 objectForKey:@"channelId"]) { 53 | _channelId = [dict2 objectForKey:@"channelId"]; 54 | } 55 | } 56 | 57 | } 58 | return self; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_Language.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Language.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/i18nLanguages#properties 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_Language : NSObject 14 | 15 | @property (strong, nonatomic) NSString *kind; 16 | @property (strong, nonatomic) NSString *etag; 17 | @property (strong, nonatomic) NSString *identifier; 18 | @property (strong, nonatomic) NSString *hl; 19 | @property (strong, nonatomic) NSString *name; 20 | 21 | - (id) initFromDictionary:(NSDictionary *)dict; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_Language.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Language.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/i18nLanguages#properties 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_Language.h" 12 | 13 | @implementation MABYT3_Language 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#i18nLanguage"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _hl = @""; 23 | _name = @""; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _kind = @"youtube#i18nLanguage"; 33 | _etag = @""; 34 | _identifier = @""; 35 | _hl = @""; 36 | _name = @""; 37 | 38 | if ([dict objectForKey:@"kind"]) { 39 | _kind = [dict objectForKey:@"kind"]; 40 | } 41 | if ([dict objectForKey:@"etag"]) { 42 | _etag = [dict objectForKey:@"etag"]; 43 | } 44 | if ([dict objectForKey:@"id"]) { 45 | _identifier = [dict objectForKey:@"id"]; 46 | } 47 | if ([dict objectForKey:@"snippet"]) { 48 | NSDictionary *dict2 = [dict objectForKey:@"snippet"]; 49 | if ([dict2 objectForKey:@"hl"]) { 50 | _hl = [dict2 objectForKey:@"hl"]; 51 | } 52 | if ([dict2 objectForKey:@"name"]) { 53 | _name = [dict2 objectForKey:@"name"]; 54 | } 55 | } 56 | 57 | } 58 | return self; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_Location.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Location.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_Location : NSObject 12 | 13 | @property (nonatomic) double latitude; 14 | @property (nonatomic) double longitude; 15 | @property (nonatomic) double altitude; 16 | 17 | - (id) initFromDictionary:(NSDictionary *)dict; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_Location.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Location.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_Location.h" 10 | 11 | @implementation MABYT3_Location 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _latitude = 0.0; 18 | _longitude = 0.0; 19 | _altitude = 0.0; 20 | } 21 | return self; 22 | } 23 | 24 | - (id) initFromDictionary:(NSDictionary *)dict { 25 | 26 | self = [super init]; 27 | if (self) { 28 | _latitude = 0.0; 29 | _longitude = 0.0; 30 | _altitude = 0.0; 31 | 32 | if ([dict objectForKey:@"latitude"]) { 33 | _latitude = [[dict objectForKey:@"latitude"] doubleValue]; 34 | } 35 | if ([dict objectForKey:@"longitude"]) { 36 | _longitude = [[dict objectForKey:@"longitude"] doubleValue]; 37 | } 38 | if ([dict objectForKey:@"altitude"]) { 39 | _altitude = [[dict objectForKey:@"altitude"] doubleValue]; 40 | } 41 | 42 | } 43 | return self; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_Region.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Region.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/i18nRegions#properties 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_Region : NSObject 14 | 15 | @property (strong, nonatomic) NSString *kind; 16 | @property (strong, nonatomic) NSString *etag; 17 | @property (strong, nonatomic) NSString *identifier; 18 | @property (strong, nonatomic) NSString *gl; 19 | @property (strong, nonatomic) NSString *name; 20 | 21 | - (id) initFromDictionary:(NSDictionary *)dict; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_Region.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Region.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/i18nRegions#properties 6 | // 7 | // Created by Muhammad Bassio on 5/2/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_Region.h" 12 | 13 | @implementation MABYT3_Region 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#i18nLanguage"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _gl = @""; 23 | _name = @""; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _kind = @"youtube#i18nLanguage"; 33 | _etag = @""; 34 | _identifier = @""; 35 | _gl = @""; 36 | _name = @""; 37 | 38 | if ([dict objectForKey:@"kind"]) { 39 | _kind = [dict objectForKey:@"kind"]; 40 | } 41 | if ([dict objectForKey:@"etag"]) { 42 | _etag = [dict objectForKey:@"etag"]; 43 | } 44 | if ([dict objectForKey:@"id"]) { 45 | _identifier = [dict objectForKey:@"id"]; 46 | } 47 | if ([dict objectForKey:@"snippet"]) { 48 | NSDictionary *dict2 = [dict objectForKey:@"snippet"]; 49 | if ([dict2 objectForKey:@"gl"]) { 50 | _gl = [dict2 objectForKey:@"gl"]; 51 | } 52 | if ([dict2 objectForKey:@"name"]) { 53 | _name = [dict2 objectForKey:@"name"]; 54 | } 55 | } 56 | 57 | } 58 | return self; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_RegionRestriction.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_RegionRestriction.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_RegionRestriction : NSObject 12 | 13 | @property (strong, nonatomic) NSMutableArray *allowed; 14 | @property (strong, nonatomic) NSMutableArray *blocked; 15 | 16 | - (id) initFromDictionary:(NSDictionary *)dict; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_RegionRestriction.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_RegionRestriction.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_RegionRestriction.h" 10 | 11 | @implementation MABYT3_RegionRestriction 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _allowed = [[NSMutableArray alloc] init]; 18 | _blocked = [[NSMutableArray alloc] init]; 19 | } 20 | return self; 21 | } 22 | 23 | - (id) initFromDictionary:(NSDictionary *)dict { 24 | 25 | self = [super init]; 26 | if (self) { 27 | _allowed = [[NSMutableArray alloc] init]; 28 | _blocked = [[NSMutableArray alloc] init]; 29 | 30 | if ([dict objectForKey:@"allowed"]) { 31 | _allowed = [[dict objectForKey:@"allowed"] mutableCopy]; 32 | } 33 | if ([dict objectForKey:@"blocked"]) { 34 | _blocked = [[dict objectForKey:@"blocked"] mutableCopy]; 35 | } 36 | 37 | } 38 | return self; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_ResourceId.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ResourceId.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_ResourceId : NSObject 12 | 13 | @property (strong, nonatomic) NSString *kind; 14 | @property (strong, nonatomic) NSString *channelId; 15 | @property (strong, nonatomic) NSString *videoId; 16 | @property (strong, nonatomic) NSString *playlistId; 17 | 18 | - (id) initFromDictionary:(NSDictionary *)dict; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_ResourceId.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SubscriptionResourceId.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/1/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_ResourceId.h" 10 | 11 | @implementation MABYT3_ResourceId 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _kind = @""; 18 | _channelId = @""; 19 | _videoId = @""; 20 | _playlistId = @""; 21 | } 22 | return self; 23 | } 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict { 26 | 27 | self = [super init]; 28 | if (self) { 29 | _kind = @""; 30 | _channelId = @""; 31 | _videoId = @""; 32 | _playlistId = @""; 33 | 34 | if ([dict objectForKey:@"kind"]) { 35 | _kind = [dict objectForKey:@"kind"]; 36 | } 37 | if ([dict objectForKey:@"channelId"]) { 38 | _channelId = [dict objectForKey:@"channelId"]; 39 | } 40 | if ([dict objectForKey:@"playlistId"]) { 41 | _playlistId = [dict objectForKey:@"playlistId"]; 42 | } 43 | if ([dict objectForKey:@"videoId"]) { 44 | _videoId = [dict objectForKey:@"videoId"]; 45 | } 46 | } 47 | return self; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_Thumbnail.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Thumbnail.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_Thumbnail : NSObject 12 | 13 | @property (strong, nonatomic, readonly) NSString *url; 14 | @property (nonatomic, readonly) NSUInteger width; 15 | @property (nonatomic, readonly) NSUInteger height; 16 | 17 | - (id) initFromDictionary:(NSDictionary *)dict; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_Thumbnail.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Thumbnail.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_Thumbnail.h" 10 | 11 | @implementation MABYT3_Thumbnail 12 | 13 | - (id) init { 14 | self = [super init]; 15 | if (self) { 16 | _url = @""; 17 | _width = 0; 18 | _height = 0; 19 | } 20 | return self; 21 | } 22 | 23 | - (id) initFromDictionary:(NSDictionary *)dict { 24 | 25 | self = [super init]; 26 | if (self) { 27 | _url = @""; 28 | _width = 0; 29 | _height = 0; 30 | 31 | if ([dict objectForKey:@"url"]) { 32 | _url = [dict objectForKey:@"url"]; 33 | } 34 | if ([dict objectForKey:@"width"]) { 35 | _width = [[dict objectForKey:@"width"] integerValue]; 36 | } 37 | if ([dict objectForKey:@"height"]) { 38 | _height = [[dict objectForKey:@"height"] integerValue]; 39 | } 40 | } 41 | return self; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_VideoCategory.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoCategory.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/videoCategories#properties 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_VideoCategory : NSObject 14 | 15 | @property (strong, nonatomic) NSString *kind; 16 | @property (strong, nonatomic) NSString *etag; 17 | @property (strong, nonatomic) NSString *identifier; 18 | @property (strong, nonatomic) NSString *channelId; 19 | @property (strong, nonatomic) NSString *title; 20 | @property (nonatomic) BOOL assignable; 21 | 22 | - (id) initFromDictionary:(NSDictionary *)dict; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_VideoCategory.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoCategory.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/videoCategories#properties 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_VideoCategory.h" 12 | 13 | @implementation MABYT3_VideoCategory 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#videoCategory"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _channelId = @""; 23 | _title = @""; 24 | _assignable = NO; 25 | } 26 | return self; 27 | } 28 | 29 | - (id) initFromDictionary:(NSDictionary *)dict { 30 | 31 | self = [super init]; 32 | if (self) { 33 | _kind = @"youtube#videoCategory"; 34 | _etag = @""; 35 | _identifier = @""; 36 | _channelId = @""; 37 | _title = @""; 38 | _assignable = NO; 39 | 40 | if ([dict objectForKey:@"kind"]) { 41 | _kind = [dict objectForKey:@"kind"]; 42 | } 43 | if ([dict objectForKey:@"etag"]) { 44 | _etag = [dict objectForKey:@"etag"]; 45 | } 46 | if ([dict objectForKey:@"id"]) { 47 | _identifier = [dict objectForKey:@"id"]; 48 | } 49 | if ([dict objectForKey:@"snippet"]) { 50 | NSDictionary *dict2 = [dict objectForKey:@"snippet"]; 51 | if ([dict2 objectForKey:@"title"]) { 52 | _title = [dict2 objectForKey:@"title"]; 53 | } 54 | if ([dict2 objectForKey:@"channelId"]) { 55 | _channelId = [dict2 objectForKey:@"channelId"]; 56 | } 57 | if ([dict2 objectForKey:@"assignable"]) { 58 | _assignable = [[dict2 objectForKey:@"assignable"] boolValue]; 59 | } 60 | } 61 | 62 | } 63 | return self; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /YTAPI3/API/MABYT3_enums.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_enums.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/2/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #ifndef YTAPI3Demo_MABYT3_enums_h 10 | #define YTAPI3Demo_MABYT3_enums_h 11 | 12 | typedef enum { 13 | kYTPrivacyStatusPrivate, 14 | kYTPrivacyStatusPublic, 15 | kYTPrivacyStatusUnlisted 16 | } YTPrivacyStatus; 17 | 18 | typedef enum { 19 | kYTActivityBulletin, 20 | kYTActivityChannelItem, 21 | kYTActivityComment, 22 | kYTActivityFavorite, 23 | kYTActivityLike, 24 | kYTActivityPlaylistItem, 25 | kYTActivityRecommendation, 26 | kYTActivitySocial, 27 | kYTActivitySubscription, 28 | kYTActivityUpload 29 | } YTActivityFeedType; 30 | 31 | typedef enum { 32 | kYTInVideoPromotionTypeStart, 33 | kYTInVideoPromotionTypeEnd 34 | } YTInVideoPromotionType; 35 | 36 | typedef enum { 37 | kYTPromotedResourceTypeVideo, 38 | kYTPromotedResourceTypeWebsite, 39 | kYTPromotedResourceTypeRecentUpload 40 | } YTPromotedResourceType; 41 | 42 | typedef enum { 43 | kYTInVideoPromotionPositionTypeCorner 44 | } YTInVideoPromotionPositionType; 45 | 46 | typedef enum { 47 | kYTInVideoPromotionCornerPositionbottomLeft, 48 | kYTInVideoPromotionCornerPositionbottomRight, 49 | kYTInVideoPromotionCornerPositiontopLeft, 50 | kYTInVideoPromotionCornerPositiontopRight 51 | } YTInVideoPromotionCornerPosition; 52 | 53 | typedef enum { 54 | kYTChannelSectioTypeAllPlaylists, 55 | kYTChannelSectioTypeCompletedEvents, 56 | kYTChannelSectioTypeLikedPlaylists, 57 | kYTChannelSectioTypeLikes, 58 | kYTChannelSectioTypeLiveEvents, 59 | kYTChannelSectioTypeMultipleChannels, 60 | kYTChannelSectioTypeMultiplePlaylists, 61 | kYTChannelSectioTypePopularUploads, 62 | kYTChannelSectioTypeRecentActivity, 63 | kYTChannelSectioTypeRecentPosts, 64 | kYTChannelSectioTypeRecentUploads, 65 | kYTChannelSectioTypeSinglePlaylist, 66 | kYTChannelSectioTypeUpcomingEvents 67 | } YTChannelSectioType; 68 | 69 | typedef enum { 70 | kYTChannelSectioStyleHorizontalRow, 71 | kYTChannelSectioStyleVerticalList 72 | } YTChannelSectioStyle; 73 | 74 | typedef enum { 75 | kYTActivityTypeAll, 76 | kYTActivityTypeUploads 77 | } YTActivityType; 78 | 79 | typedef enum { 80 | kYTLiveBroadcastContentNone, 81 | kYTLiveBroadcastContentUpcoming, 82 | kYTLiveBroadcastContentLive 83 | } YTLiveBroadcastContent; 84 | 85 | typedef enum { 86 | kYTVideoDimension2D, 87 | kYTVideoDimension3D 88 | } YTVideoDimension; 89 | 90 | typedef enum { 91 | kYTVideoDefinitionSD, 92 | kYTVideoDefinitionHD 93 | } YTVideoDefinition; 94 | 95 | typedef enum { 96 | kYTVideoLicenseCC, 97 | kYTVideoLicenseYT 98 | } YTVideoLicense; 99 | 100 | typedef enum { 101 | kYTVideoUploadStatusDeleted, 102 | kYTVideoUploadStatusFailed, 103 | kYTVideoUploadStatusProcessed, 104 | kYTVideoUploadStatusRejected, 105 | kYTVideoUploadStatusUploaded 106 | } YTVideoUploadStatus; 107 | 108 | /* 109 | typedef enum { 110 | YTVideoUploadFailureReasonCodec, 111 | kYTVideoUploadStatusFailed, 112 | kYTVideoUploadStatusProcessed, 113 | kYTVideoUploadStatusRejected, 114 | kYTVideoUploadStatusUploaded 115 | } YTVideoUploadFailureReason; 116 | 117 | */ 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /YTAPI3/API/MAB_GDate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MAB_Tuber_YouTubeDate.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MAB_GDate : NSObject 12 | 13 | @property (nonatomic) NSUInteger day; 14 | @property (nonatomic) NSUInteger month; 15 | @property (strong, nonatomic) NSString *min_string; 16 | @property (nonatomic) NSUInteger year; 17 | @property (nonatomic) NSUInteger hour; 18 | @property (nonatomic) NSUInteger minute; 19 | @property (nonatomic) NSUInteger second; 20 | @property (strong, nonatomic) NSString *stringValue; 21 | @property (strong, nonatomic) NSDate *dateValue; 22 | 23 | - (id) initFromString:(NSString *)textString; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /YTAPI3/API/MAB_GDate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MAB_Tuber_YouTubeDate.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MAB_GDate.h" 10 | 11 | @implementation MAB_GDate 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _day = 1; 18 | _month = 1; 19 | _year = 2000; 20 | _hour = 0; 21 | _minute = 0; 22 | _second = 0; 23 | _stringValue = @"2000-01-01 00:00:00"; 24 | _dateValue = [NSDate date]; 25 | } 26 | return self; 27 | } 28 | 29 | - (id) initFromString:(NSString *)textString { 30 | 31 | self = [super init]; 32 | if (self) { 33 | 34 | _day = 1; 35 | _month = 1; 36 | _year = 2000; 37 | _hour = 0; 38 | _minute = 0; 39 | _second = 0; 40 | _stringValue = @"2000-01-01 00:00:00"; 41 | _dateValue = [NSDate date]; 42 | 43 | _stringValue = [[textString stringByReplacingOccurrencesOfString:@"T" withString:@" "] stringByReplacingOccurrencesOfString:@"Z" withString:@""]; 44 | 45 | NSArray *textArray = [[textString stringByReplacingOccurrencesOfString:@"Z" withString:@""] componentsSeparatedByString:@"T"]; 46 | NSArray *dateArray = [[textArray objectAtIndex:0] componentsSeparatedByString:@"-"]; 47 | NSArray *timeArray = [[textArray objectAtIndex:1] componentsSeparatedByString:@":"]; 48 | 49 | NSNumberFormatter * formater = [[NSNumberFormatter alloc] init]; 50 | [formater setNumberStyle:NSNumberFormatterDecimalStyle]; 51 | 52 | _year = [[dateArray objectAtIndex:0] integerValue]; 53 | _month = [[dateArray objectAtIndex:1] integerValue]; 54 | _day = [[dateArray objectAtIndex:2] integerValue]; 55 | 56 | _hour = [[timeArray objectAtIndex:0] integerValue]; 57 | _minute = [[timeArray objectAtIndex:1] integerValue]; 58 | _second = [[timeArray objectAtIndex:2] integerValue]; 59 | 60 | NSInteger secondsFromGMT = [[NSTimeZone localTimeZone] secondsFromGMT]; 61 | NSDateComponents *components = [[NSDateComponents alloc] init]; 62 | NSCalendar *cal = [NSCalendar currentCalendar]; 63 | [cal setTimeZone:[NSTimeZone localTimeZone]]; 64 | 65 | [components setDay:_day]; 66 | [components setMonth:_month]; 67 | [components setYear:_year]; 68 | [components setHour:_hour]; 69 | [components setMinute:_minute]; 70 | [components setSecond:_second]; 71 | 72 | _dateValue = [[cal dateFromComponents:components] dateByAddingTimeInterval:secondsFromGMT]; 73 | _min_string = [NSString stringWithFormat:@"%lu %@ %lu", (unsigned long)_day, [self monthString:_month], (unsigned long)_year]; 74 | 75 | } 76 | return self; 77 | } 78 | 79 | 80 | - (NSString *)monthString:(NSUInteger)mnth { 81 | 82 | NSString *retVal = @"Jan"; 83 | 84 | switch (mnth) { 85 | case 2: 86 | { 87 | retVal = @"Feb"; 88 | break; 89 | } 90 | case 3: 91 | { 92 | retVal = @"Mar"; 93 | break; 94 | } 95 | case 4: 96 | { 97 | retVal = @"Apr"; 98 | break; 99 | } 100 | case 5: 101 | { 102 | retVal = @"May"; 103 | break; 104 | } 105 | case 6: 106 | { 107 | retVal = @"Jun"; 108 | break; 109 | } 110 | case 7: 111 | { 112 | retVal = @"Jul"; 113 | break; 114 | } 115 | case 8: 116 | { 117 | retVal = @"Aug"; 118 | break; 119 | } 120 | case 9: 121 | { 122 | retVal = @"Sep"; 123 | break; 124 | } 125 | case 10: 126 | { 127 | retVal = @"Oct"; 128 | break; 129 | } 130 | case 11: 131 | { 132 | retVal = @"Nov"; 133 | break; 134 | } 135 | case 12: 136 | { 137 | retVal = @"Dec"; 138 | break; 139 | } 140 | default: 141 | break; 142 | } 143 | 144 | return retVal; 145 | } 146 | 147 | @end 148 | -------------------------------------------------------------------------------- /YTAPI3/API/MAB_GLink.h: -------------------------------------------------------------------------------- 1 | // 2 | // MAB_GLink.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MAB_GLink : NSObject 12 | 13 | @property (strong, nonatomic) NSString *rel; 14 | @property (strong, nonatomic) NSString *type; 15 | @property (strong, nonatomic) NSString *href; 16 | @property (nonatomic) NSUInteger countHint; 17 | 18 | - (id) initFromDictionary:(NSDictionary *)textdict; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /YTAPI3/API/MAB_GLink.m: -------------------------------------------------------------------------------- 1 | // 2 | // MAB_GLink.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MAB_GLink.h" 10 | 11 | @implementation MAB_GLink 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _rel = @""; 18 | _type = @""; 19 | _href = @""; 20 | _countHint = 0; 21 | } 22 | return self; 23 | } 24 | 25 | - (id) initFromDictionary:(NSDictionary *)textdict { 26 | 27 | self = [super init]; 28 | if (self) { 29 | _rel = @""; 30 | _type = @""; 31 | _href = @""; 32 | 33 | if ([textdict objectForKey:@"rel"]) { 34 | _rel = [textdict objectForKey:@"rel"]; 35 | } 36 | if ([textdict objectForKey:@"type"]) { 37 | _type = [textdict objectForKey:@"type"]; 38 | } 39 | if ([textdict objectForKey:@"href"]) { 40 | _href = [textdict objectForKey:@"href"]; 41 | } 42 | if ([textdict objectForKey:@"countHint"]) { 43 | _countHint = [[textdict objectForKey:@"countHint"] integerValue]; 44 | } 45 | 46 | } 47 | return self; 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayList/MABYT3_PlayList.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayList.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/playlists#properties 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_enums.h" 13 | #import "MABYT3_PlayListSnippet.h" 14 | #import "MABYT3_PlayListContentDetails.h" 15 | 16 | @interface MABYT3_PlayList : NSObject 17 | 18 | @property (strong, nonatomic) NSString *kind; 19 | @property (strong, nonatomic) NSString *etag; 20 | @property (strong, nonatomic) NSString *identifier; 21 | @property (strong, nonatomic) MABYT3_PlayListSnippet *snippet; 22 | //@property (strong, nonatomic) MABYT3_PlayListContentDetails *contentDetails; 23 | @property (nonatomic) YTPrivacyStatus privacyStatus; 24 | @property (strong, nonatomic) NSString *embedHtml; 25 | @property (nonatomic) NSUInteger itemCount; 26 | 27 | - (id) initFromDictionary:(NSDictionary *)dict; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayList/MABYT3_PlayList.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayList.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/playlists#properties 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_PlayList.h" 12 | 13 | @implementation MABYT3_PlayList 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#playlist"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _snippet = [[MABYT3_PlayListSnippet alloc] init]; 23 | //_contentDetails = [[MABYT3_PlayListContentDetails alloc] init]; 24 | _privacyStatus = kYTPrivacyStatusPublic; 25 | _embedHtml = @""; 26 | _itemCount = 0; 27 | } 28 | return self; 29 | } 30 | 31 | - (id) initFromDictionary:(NSDictionary *)dict { 32 | 33 | self = [super init]; 34 | if (self) { 35 | _kind = @"youtube#playlist"; 36 | _etag = @""; 37 | _identifier = @""; 38 | _snippet = [[MABYT3_PlayListSnippet alloc] init]; 39 | //_contentDetails = [[MABYT3_PlayListContentDetails alloc] init]; 40 | _privacyStatus = kYTPrivacyStatusPublic; 41 | _embedHtml = @""; 42 | _itemCount = 0; 43 | 44 | if ([dict objectForKey:@"kind"]) { 45 | _kind = [dict objectForKey:@"kind"]; 46 | } 47 | if ([dict objectForKey:@"etag"]) { 48 | _etag = [dict objectForKey:@"etag"]; 49 | } 50 | if ([dict objectForKey:@"id"]) { 51 | _identifier = [dict objectForKey:@"id"]; 52 | } 53 | if ([dict objectForKey:@"snippet"]) { 54 | _snippet = [[MABYT3_PlayListSnippet alloc] initFromDictionary:[dict objectForKey:@"snippet"]]; 55 | } 56 | if ([dict objectForKey:@"contentDetails"]) { 57 | //_contentDetails = [[MABYT3_PlayListContentDetails alloc] initFromDictionary:[dict objectForKey:@"contentDetails"]]; 58 | NSDictionary *dict2 = [dict objectForKey:@"contentDetails"]; 59 | if ([dict2 objectForKey:@"itemCount"]) { 60 | _itemCount = [[dict2 objectForKey:@"itemCount"] unsignedIntegerValue]; 61 | } 62 | } 63 | if ([dict objectForKey:@"status"]) { 64 | NSDictionary *dict2 = [dict objectForKey:@"status"]; 65 | if ([dict2 objectForKey:@"privacyStatus"]) { 66 | _privacyStatus = [self privacyStatusFromString:[dict2 objectForKey:@"privacyStatus"]]; 67 | } 68 | } 69 | if ([dict objectForKey:@"player"]) { 70 | NSDictionary *dict2 = [dict objectForKey:@"player"]; 71 | if ([dict2 objectForKey:@"privacyStatus"]) { 72 | _embedHtml = [dict2 objectForKey:@"embedHtml"]; 73 | } 74 | } 75 | } 76 | return self; 77 | } 78 | 79 | - (YTPrivacyStatus) privacyStatusFromString:(NSString *)prvString { 80 | 81 | YTPrivacyStatus retVal = kYTPrivacyStatusPublic; 82 | 83 | if ([prvString isEqualToString:@"private"]) { 84 | retVal = kYTPrivacyStatusPrivate; 85 | } 86 | else if ([prvString isEqualToString:@"unlisted"]) { 87 | retVal = kYTPrivacyStatusUnlisted; 88 | } 89 | return retVal; 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayList/MABYT3_PlayListContentDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayListContentDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_PlayListContentDetails : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayList/MABYT3_PlayListContentDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayListContentDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_PlayListContentDetails.h" 10 | 11 | @implementation MABYT3_PlayListContentDetails 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayList/MABYT3_PlayListSnippet.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayListSnippet.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/playlists#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MAB_GDate.h" 13 | #import "MABYT3_Thumbnail.h" 14 | 15 | @interface MABYT3_PlayListSnippet : NSObject 16 | 17 | @property (strong, nonatomic) MAB_GDate *publishedAt; 18 | @property (strong, nonatomic) NSString *channelId; 19 | @property (strong, nonatomic) NSString *title; 20 | @property (strong, nonatomic) NSString *description; 21 | @property (strong, nonatomic) NSMutableDictionary *thumbnails; 22 | @property (strong, nonatomic) NSString *channelTitle; 23 | @property (strong, nonatomic) NSMutableArray *tags; 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayList/MABYT3_PlayListSnippet.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayListSnippet.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/playlists#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_PlayListSnippet.h" 12 | 13 | @implementation MABYT3_PlayListSnippet 14 | 15 | @synthesize description = _description; 16 | 17 | - (id) init { 18 | 19 | self = [super init]; 20 | if (self) { 21 | _publishedAt = [[MAB_GDate alloc] init]; 22 | _channelId = @""; 23 | _title = @""; 24 | _description = @""; 25 | _thumbnails = [[NSMutableDictionary alloc] init]; 26 | _channelTitle = @""; 27 | _tags = [[NSMutableArray alloc] init]; 28 | } 29 | return self; 30 | } 31 | 32 | - (id) initFromDictionary:(NSDictionary *)dict { 33 | 34 | self = [super init]; 35 | if (self) { 36 | _publishedAt = [[MAB_GDate alloc] init]; 37 | _channelId = @""; 38 | _title = @""; 39 | _description = @""; 40 | _thumbnails = [[NSMutableDictionary alloc] init]; 41 | _channelTitle = @""; 42 | _tags = [[NSMutableArray alloc] init]; 43 | 44 | if ([dict objectForKey:@"publishedAt"]) { 45 | _publishedAt = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"publishedAt"]]; 46 | } 47 | if ([dict objectForKey:@"channelId"]) { 48 | _channelId = [dict objectForKey:@"channelId"]; 49 | } 50 | if ([dict objectForKey:@"title"]) { 51 | _title = [dict objectForKey:@"title"]; 52 | } 53 | if ([dict objectForKey:@"description"]) { 54 | _description = [dict objectForKey:@"description"]; 55 | } 56 | if ([dict objectForKey:@"channelTitle"]) { 57 | _channelTitle = [dict objectForKey:@"channelTitle"]; 58 | } 59 | if ([dict objectForKey:@"tags"]) { 60 | _tags = [[dict objectForKey:@"tags"] mutableCopy]; 61 | } 62 | 63 | if ([dict objectForKey:@"thumbnails"]) { 64 | NSDictionary *thmbDict = [dict objectForKey:@"thumbnails"]; 65 | NSArray *keys = [thmbDict allKeys]; 66 | for (int i = 0; i < keys.count; i++) { 67 | MABYT3_Thumbnail *thmb = [[MABYT3_Thumbnail alloc] initFromDictionary:[thmbDict objectForKey:keys[i]]]; 68 | [_thumbnails setObject:thmb forKey:keys[i]]; 69 | } 70 | } 71 | } 72 | return self; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayListItem/MABYT3_PlayListItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayListItem.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/playlistItems#properties 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_enums.h" 13 | #import "MABYT3_PlayListItemSnippet.h" 14 | #import "MABYT3_PlayListItemContentDetails.h" 15 | 16 | @interface MABYT3_PlayListItem : NSObject 17 | 18 | @property (strong, nonatomic) NSString *kind; 19 | @property (strong, nonatomic) NSString *etag; 20 | @property (strong, nonatomic) NSString *identifier; 21 | @property (strong, nonatomic) MABYT3_PlayListItemSnippet *snippet; 22 | @property (strong, nonatomic) MABYT3_PlayListItemContentDetails *contentDetails; 23 | @property (nonatomic) YTPrivacyStatus privacyStatus; 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayListItem/MABYT3_PlayListItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayListItem.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/playlistItems#properties 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_PlayListItem.h" 12 | 13 | @implementation MABYT3_PlayListItem 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#playlistItem"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _snippet = [[MABYT3_PlayListItemSnippet alloc] init]; 23 | _contentDetails = [[MABYT3_PlayListItemContentDetails alloc] init]; 24 | _privacyStatus = kYTPrivacyStatusPublic; 25 | } 26 | return self; 27 | } 28 | 29 | - (id) initFromDictionary:(NSDictionary *)dict { 30 | 31 | self = [super init]; 32 | if (self) { 33 | _kind = @"youtube#playlistItem"; 34 | _etag = @""; 35 | _identifier = @""; 36 | _snippet = [[MABYT3_PlayListItemSnippet alloc] init]; 37 | _contentDetails = [[MABYT3_PlayListItemContentDetails alloc] init]; 38 | _privacyStatus = kYTPrivacyStatusPublic; 39 | 40 | if ([dict objectForKey:@"kind"]) { 41 | _kind = [dict objectForKey:@"kind"]; 42 | } 43 | if ([dict objectForKey:@"etag"]) { 44 | _etag = [dict objectForKey:@"etag"]; 45 | } 46 | if ([dict objectForKey:@"id"]) { 47 | _identifier = [dict objectForKey:@"id"]; 48 | } 49 | if ([dict objectForKey:@"snippet"]) { 50 | _snippet = [[MABYT3_PlayListItemSnippet alloc] initFromDictionary:[dict objectForKey:@"snippet"]]; 51 | } 52 | if ([dict objectForKey:@"contentDetails"]) { 53 | _contentDetails = [[MABYT3_PlayListItemContentDetails alloc] initFromDictionary:[dict objectForKey:@"contentDetails"]]; 54 | } 55 | if ([dict objectForKey:@"status"]) { 56 | NSDictionary *dict2 = [dict objectForKey:@"status"]; 57 | if ([dict2 objectForKey:@"privacyStatus"]) { 58 | _privacyStatus = [self privacyStatusFromString:[dict2 objectForKey:@"privacyStatus"]]; 59 | } 60 | } 61 | } 62 | return self; 63 | } 64 | 65 | - (YTPrivacyStatus) privacyStatusFromString:(NSString *)prvString { 66 | 67 | YTPrivacyStatus retVal = kYTPrivacyStatusPublic; 68 | 69 | if ([prvString isEqualToString:@"private"]) { 70 | retVal = kYTPrivacyStatusPrivate; 71 | } 72 | else if ([prvString isEqualToString:@"unlisted"]) { 73 | retVal = kYTPrivacyStatusUnlisted; 74 | } 75 | return retVal; 76 | } 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayListItem/MABYT3_PlayListItemContentDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayListItemContentDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/playlistItems#contentDetails 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | 13 | @interface MABYT3_PlayListItemContentDetails : NSObject 14 | 15 | @property (strong, nonatomic) NSString *videoId; 16 | @property (strong, nonatomic) NSString *startAt; 17 | @property (strong, nonatomic) NSString *endAt; 18 | @property (strong, nonatomic) NSString *note; 19 | 20 | - (id) initFromDictionary:(NSDictionary *)dict; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayListItem/MABYT3_PlayListItemContentDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayListItemContentDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/playlistItems#contentDetails 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_PlayListItemContentDetails.h" 12 | 13 | @implementation MABYT3_PlayListItemContentDetails 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _videoId = @""; 20 | _startAt = @""; 21 | _endAt = @""; 22 | _note = @""; 23 | } 24 | return self; 25 | } 26 | 27 | - (id) initFromDictionary:(NSDictionary *)dict { 28 | 29 | self = [super init]; 30 | if (self) { 31 | _videoId = @""; 32 | _startAt = @"0"; 33 | _endAt = @"0"; 34 | _note = @""; 35 | 36 | if ([dict objectForKey:@"videoId"]) { 37 | _videoId = [dict objectForKey:@"videoId"]; 38 | } 39 | if ([dict objectForKey:@"startAt"]) { 40 | _startAt = [dict objectForKey:@"startAt"]; 41 | } 42 | if ([dict objectForKey:@"endAt"]) { 43 | _endAt = [dict objectForKey:@"endAt"]; 44 | } 45 | if ([dict objectForKey:@"note"]) { 46 | _note = [dict objectForKey:@"note"]; 47 | } 48 | } 49 | return self; 50 | } 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayListItem/MABYT3_PlayListItemSnippet.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayListItemSnippet.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/playlistItems#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MAB_GDate.h" 13 | #import "MABYT3_Thumbnail.h" 14 | #import "MABYT3_ResourceId.h" 15 | 16 | @interface MABYT3_PlayListItemSnippet : NSObject 17 | 18 | @property (strong, nonatomic) MAB_GDate *publishedAt; 19 | @property (strong, nonatomic) NSString *channelId; 20 | @property (strong, nonatomic) NSString *title; 21 | @property (strong, nonatomic) NSString *description; 22 | @property (strong, nonatomic) NSMutableDictionary *thumbnails; 23 | @property (strong, nonatomic) NSString *channelTitle; 24 | @property (strong, nonatomic) NSString *playlistId; 25 | @property (nonatomic) NSUInteger position; 26 | @property (strong, nonatomic) MABYT3_ResourceId *resourceId; 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /YTAPI3/API/PlayListItem/MABYT3_PlayListItemSnippet.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_PlayListItemSnippet.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/playlistItems#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_PlayListItemSnippet.h" 12 | 13 | @implementation MABYT3_PlayListItemSnippet 14 | 15 | @synthesize description = _description; 16 | 17 | - (id) init { 18 | 19 | self = [super init]; 20 | if (self) { 21 | _publishedAt = [[MAB_GDate alloc] init]; 22 | _channelId = @""; 23 | _title = @""; 24 | _description = @""; 25 | _thumbnails = [[NSMutableDictionary alloc] init]; 26 | _channelTitle = @""; 27 | _playlistId = @""; 28 | _position = 0; 29 | _resourceId = [[MABYT3_ResourceId alloc] init]; 30 | } 31 | return self; 32 | } 33 | 34 | - (id) initFromDictionary:(NSDictionary *)dict { 35 | 36 | self = [super init]; 37 | if (self) { 38 | _publishedAt = [[MAB_GDate alloc] init]; 39 | _channelId = @""; 40 | _title = @""; 41 | _description = @""; 42 | _thumbnails = [[NSMutableDictionary alloc] init]; 43 | _channelTitle = @""; 44 | _playlistId = @""; 45 | _position = 0; 46 | _resourceId = [[MABYT3_ResourceId alloc] init]; 47 | 48 | if ([dict objectForKey:@"publishedAt"]) { 49 | _publishedAt = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"publishedAt"]]; 50 | } 51 | if ([dict objectForKey:@"channelId"]) { 52 | _channelId = [dict objectForKey:@"channelId"]; 53 | } 54 | if ([dict objectForKey:@"title"]) { 55 | _title = [dict objectForKey:@"title"]; 56 | } 57 | if ([dict objectForKey:@"description"]) { 58 | _description = [dict objectForKey:@"description"]; 59 | } 60 | if ([dict objectForKey:@"channelTitle"]) { 61 | _channelTitle = [dict objectForKey:@"channelTitle"]; 62 | } 63 | if ([dict objectForKey:@"playlistId"]) { 64 | _playlistId = [dict objectForKey:@"playlistId"]; 65 | } 66 | if ([dict objectForKey:@"position"]) { 67 | _position = [[dict objectForKey:@"position"] unsignedIntegerValue]; 68 | } 69 | if ([dict objectForKey:@"resourceId"]) { 70 | _resourceId = [[MABYT3_ResourceId alloc] initFromDictionary:[dict objectForKey:@"resourceId"]]; 71 | } 72 | 73 | if ([dict objectForKey:@"thumbnails"]) { 74 | NSDictionary *thmbDict = [dict objectForKey:@"thumbnails"]; 75 | NSArray *keys = [thmbDict allKeys]; 76 | for (int i = 0; i < keys.count; i++) { 77 | MABYT3_Thumbnail *thmb = [[MABYT3_Thumbnail alloc] initFromDictionary:[thmbDict objectForKey:keys[i]]]; 78 | [_thumbnails setObject:thmb forKey:keys[i]]; 79 | } 80 | } 81 | } 82 | return self; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /YTAPI3/API/SearchItem/MABYT3_SearchItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SearchItem.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/search#properties 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_ResourceId.h" 13 | #import "MABYT3_SearchItemSnippet.h" 14 | 15 | @interface MABYT3_SearchItem : NSObject 16 | 17 | @property (strong, nonatomic) NSString *kind; 18 | @property (strong, nonatomic) NSString *etag; 19 | @property (strong, nonatomic) MABYT3_ResourceId *identifier; 20 | @property (strong, nonatomic) MABYT3_SearchItemSnippet *snippet; 21 | 22 | - (id) initFromDictionary:(NSDictionary *)dict; 23 | 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /YTAPI3/API/SearchItem/MABYT3_SearchItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SearchItem.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/search#properties 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_SearchItem.h" 12 | 13 | @implementation MABYT3_SearchItem 14 | 15 | 16 | - (id) init { 17 | 18 | self = [super init]; 19 | if (self) { 20 | _kind = @"youtube#searchResult"; 21 | _etag = @""; 22 | _identifier = [[MABYT3_ResourceId alloc] init]; 23 | _snippet = [[MABYT3_SearchItemSnippet alloc] init]; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _kind = @"youtube#searchResult"; 33 | _etag = @""; 34 | _identifier = [[MABYT3_ResourceId alloc] init]; 35 | _snippet = [[MABYT3_SearchItemSnippet alloc] init]; 36 | 37 | if ([dict objectForKey:@"kind"]) { 38 | _kind = [dict objectForKey:@"kind"]; 39 | } 40 | if ([dict objectForKey:@"etag"]) { 41 | _etag = [dict objectForKey:@"etag"]; 42 | } 43 | if ([dict objectForKey:@"id"]) { 44 | _identifier = [[MABYT3_ResourceId alloc] initFromDictionary:[dict objectForKey:@"id"]]; 45 | } 46 | if ([dict objectForKey:@"snippet"]) { 47 | _snippet = [[MABYT3_SearchItemSnippet alloc] initFromDictionary:[dict objectForKey:@"snippet"]]; 48 | } 49 | } 50 | return self; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /YTAPI3/API/SearchItem/MABYT3_SearchItemSnippet.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SearchItemSnippet.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/search#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MAB_GDate.h" 13 | #import "MABYT3_Thumbnail.h" 14 | #import "MABYT3_enums.h" 15 | 16 | @interface MABYT3_SearchItemSnippet : NSObject 17 | 18 | @property (strong, nonatomic) MAB_GDate *publishedAt; 19 | @property (strong, nonatomic) NSString *channelId; 20 | @property (strong, nonatomic) NSString *title; 21 | @property (strong, nonatomic) NSString *description; 22 | @property (strong, nonatomic) NSMutableDictionary *thumbnails; 23 | @property (strong, nonatomic) NSString *channelTitle; 24 | @property (nonatomic) YTLiveBroadcastContent liveBroadcastContent; 25 | 26 | - (id) initFromDictionary:(NSDictionary *)dict; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /YTAPI3/API/SearchItem/MABYT3_SearchItemSnippet.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SearchItemSnippet.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/search#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_SearchItemSnippet.h" 12 | 13 | @implementation MABYT3_SearchItemSnippet 14 | 15 | @synthesize description = _description; 16 | 17 | - (id) init { 18 | 19 | self = [super init]; 20 | if (self) { 21 | _publishedAt = [[MAB_GDate alloc] init]; 22 | _channelId = @""; 23 | _title = @""; 24 | _description = @""; 25 | _thumbnails = [[NSMutableDictionary alloc] init]; 26 | _channelTitle = @""; 27 | _liveBroadcastContent = kYTLiveBroadcastContentNone; 28 | } 29 | return self; 30 | } 31 | 32 | - (id) initFromDictionary:(NSDictionary *)dict { 33 | 34 | self = [super init]; 35 | if (self) { 36 | _publishedAt = [[MAB_GDate alloc] init]; 37 | _channelId = @""; 38 | _title = @""; 39 | _description = @""; 40 | _thumbnails = [[NSMutableDictionary alloc] init]; 41 | _channelTitle = @""; 42 | _liveBroadcastContent = kYTLiveBroadcastContentNone; 43 | 44 | if ([dict objectForKey:@"publishedAt"]) { 45 | _publishedAt = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"publishedAt"]]; 46 | } 47 | if ([dict objectForKey:@"channelId"]) { 48 | _channelId = [dict objectForKey:@"channelId"]; 49 | } 50 | if ([dict objectForKey:@"title"]) { 51 | _title = [dict objectForKey:@"title"]; 52 | } 53 | if ([dict objectForKey:@"description"]) { 54 | _description = [dict objectForKey:@"description"]; 55 | } 56 | if ([dict objectForKey:@"channelTitle"]) { 57 | _channelTitle = [dict objectForKey:@"channelTitle"]; 58 | } 59 | if ([dict objectForKey:@"liveBroadcastContent"]) { 60 | _liveBroadcastContent = [self liveBroadcastContentFromString:[dict objectForKey:@"liveBroadcastContent"]]; 61 | } 62 | 63 | if ([dict objectForKey:@"thumbnails"]) { 64 | NSDictionary *thmbDict = [dict objectForKey:@"thumbnails"]; 65 | NSArray *keys = [thmbDict allKeys]; 66 | for (int i = 0; i < keys.count; i++) { 67 | MABYT3_Thumbnail *thmb = [[MABYT3_Thumbnail alloc] initFromDictionary:[thmbDict objectForKey:keys[i]]]; 68 | [_thumbnails setObject:thmb forKey:keys[i]]; 69 | } 70 | } 71 | } 72 | return self; 73 | } 74 | 75 | - (YTLiveBroadcastContent) liveBroadcastContentFromString:(NSString *)prvString { 76 | 77 | YTLiveBroadcastContent retVal = kYTLiveBroadcastContentNone; 78 | 79 | if ([prvString isEqualToString:@"upcoming"]) { 80 | retVal = kYTLiveBroadcastContentUpcoming; 81 | } 82 | else if ([prvString isEqualToString:@"live"]) { 83 | retVal = kYTLiveBroadcastContentLive; 84 | } 85 | return retVal; 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /YTAPI3/API/Subscription/MABYT3_SubscriberSnippet.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SubscriberSnippet.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/subscriptions#subscriberSnippet 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_Thumbnail.h" 13 | 14 | @interface MABYT3_SubscriberSnippet : NSObject 15 | 16 | @property (strong, nonatomic) NSString *title; 17 | @property (strong, nonatomic) NSString *description; 18 | @property (strong, nonatomic) NSString *channelId; 19 | @property (strong, nonatomic) NSMutableDictionary *thumbnails; 20 | 21 | - (id) initFromDictionary:(NSDictionary *)dict; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /YTAPI3/API/Subscription/MABYT3_SubscriberSnippet.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SubscriberSnippet.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/subscriptions#subscriberSnippet 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_SubscriberSnippet.h" 12 | 13 | @implementation MABYT3_SubscriberSnippet 14 | 15 | @synthesize description = _description; 16 | 17 | - (id) init { 18 | 19 | self = [super init]; 20 | if (self) { 21 | _title = @""; 22 | _description = @""; 23 | _channelId = @""; 24 | _thumbnails = [[NSMutableDictionary alloc] init]; 25 | } 26 | return self; 27 | } 28 | 29 | - (id) initFromDictionary:(NSDictionary *)dict { 30 | 31 | self = [super init]; 32 | if (self) { 33 | _title = @""; 34 | _description = @""; 35 | _channelId = @""; 36 | _thumbnails = [[NSMutableDictionary alloc] init]; 37 | 38 | if ([dict objectForKey:@"title"]) { 39 | _title = [dict objectForKey:@"title"]; 40 | } 41 | if ([dict objectForKey:@"description"]) { 42 | _description = [dict objectForKey:@"description"]; 43 | } 44 | if ([dict objectForKey:@"channelId"]) { 45 | _channelId = [dict objectForKey:@"channelId"]; 46 | } 47 | 48 | if ([dict objectForKey:@"thumbnails"]) { 49 | NSDictionary *thmbDict = [dict objectForKey:@"thumbnails"]; 50 | NSArray *keys = [thmbDict allKeys]; 51 | for (int i = 0; i < keys.count; i++) { 52 | MABYT3_Thumbnail *thmb = [[MABYT3_Thumbnail alloc] initFromDictionary:[thmbDict objectForKey:keys[i]]]; 53 | [_thumbnails setObject:thmb forKey:keys[i]]; 54 | } 55 | } 56 | } 57 | return self; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /YTAPI3/API/Subscription/MABYT3_Subscription.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Subscription.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/subscriptions#properties 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_SubscriptionSnippet.h" 13 | #import "MABYT3_SubscriptionContentDetails.h" 14 | #import "MABYT3_SubscriberSnippet.h" 15 | 16 | @interface MABYT3_Subscription : NSObject 17 | 18 | @property (strong, nonatomic) NSString *kind; 19 | @property (strong, nonatomic) NSString *etag; 20 | @property (strong, nonatomic) NSString *identifier; 21 | @property (strong, nonatomic) MABYT3_SubscriptionSnippet *snippet; 22 | @property (strong, nonatomic) MABYT3_SubscriptionContentDetails *contentDetails; 23 | @property (strong, nonatomic) MABYT3_SubscriberSnippet *subscriberSnippet; 24 | 25 | - (id) initFromDictionary:(NSDictionary *)dict; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /YTAPI3/API/Subscription/MABYT3_Subscription.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Subscription.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/subscriptions#properties 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_Subscription.h" 12 | 13 | @implementation MABYT3_Subscription 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#subscription"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _snippet = [[MABYT3_SubscriptionSnippet alloc] init]; 23 | _contentDetails = [[MABYT3_SubscriptionContentDetails alloc] init]; 24 | _subscriberSnippet = [[MABYT3_SubscriberSnippet alloc] init]; 25 | } 26 | return self; 27 | } 28 | 29 | - (id) initFromDictionary:(NSDictionary *)dict { 30 | 31 | self = [super init]; 32 | if (self) { 33 | _kind = @"youtube#subscription"; 34 | _etag = @""; 35 | _identifier = @""; 36 | _snippet = [[MABYT3_SubscriptionSnippet alloc] init]; 37 | _contentDetails = [[MABYT3_SubscriptionContentDetails alloc] init]; 38 | _subscriberSnippet = [[MABYT3_SubscriberSnippet alloc] init]; 39 | 40 | if ([dict objectForKey:@"kind"]) { 41 | _kind = [dict objectForKey:@"kind"]; 42 | } 43 | if ([dict objectForKey:@"etag"]) { 44 | _etag = [dict objectForKey:@"etag"]; 45 | } 46 | if ([dict objectForKey:@"id"]) { 47 | _identifier = [dict objectForKey:@"id"]; 48 | } 49 | if ([dict objectForKey:@"snippet"]) { 50 | _snippet = [[MABYT3_SubscriptionSnippet alloc] initFromDictionary:[dict objectForKey:@"snippet"]]; 51 | } 52 | if ([dict objectForKey:@"contentDetails"]) { 53 | _contentDetails = [[MABYT3_SubscriptionContentDetails alloc] initFromDictionary:[dict objectForKey:@"contentDetails"]]; 54 | } 55 | if ([dict objectForKey:@"subscriberSnippet"]) { 56 | _subscriberSnippet = [[MABYT3_SubscriberSnippet alloc] initFromDictionary:[dict objectForKey:@"subscriberSnippet"]]; 57 | } 58 | } 59 | return self; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /YTAPI3/API/Subscription/MABYT3_SubscriptionContentDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SubscriptionContentDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/subscriptions#contentDetails 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_enums.h" 13 | 14 | @interface MABYT3_SubscriptionContentDetails : NSObject 15 | 16 | @property (nonatomic) unsigned long totalItemCount; 17 | @property (nonatomic) unsigned long newItemCount; 18 | @property (nonatomic) YTActivityType activityType; 19 | 20 | - (id) initFromDictionary:(NSDictionary *)dict; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /YTAPI3/API/Subscription/MABYT3_SubscriptionContentDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SubscriptionContentDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/subscriptions#contentDetails 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_SubscriptionContentDetails.h" 12 | 13 | @implementation MABYT3_SubscriptionContentDetails 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _totalItemCount = 0; 20 | _newItemCount = 0; 21 | _activityType = kYTActivityTypeAll; 22 | } 23 | return self; 24 | } 25 | 26 | - (id) initFromDictionary:(NSDictionary *)dict { 27 | 28 | self = [super init]; 29 | if (self) { 30 | _totalItemCount = 0; 31 | _newItemCount = 0; 32 | _activityType = kYTActivityTypeAll; 33 | 34 | if ([dict objectForKey:@"totalItemCount"]) { 35 | _totalItemCount = [[dict objectForKey:@"totalItemCount"] unsignedLongValue]; 36 | } 37 | if ([dict objectForKey:@"newItemCount"]) { 38 | _newItemCount = [[dict objectForKey:@"newItemCount"] unsignedLongValue]; 39 | } 40 | if ([dict objectForKey:@"activityType"]) { 41 | if ([[dict objectForKey:@"activityType"] isEqualToString:@"uploads"]) { 42 | _activityType = kYTActivityTypeUploads; 43 | } 44 | } 45 | 46 | } 47 | return self; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /YTAPI3/API/Subscription/MABYT3_SubscriptionSnippet.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SubscriptionSnippet.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/subscriptions#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MAB_GDate.h" 13 | #import "MABYT3_ResourceId.h" 14 | #import "MABYT3_Thumbnail.h" 15 | 16 | @interface MABYT3_SubscriptionSnippet : NSObject 17 | 18 | @property (strong, nonatomic) MAB_GDate *publishedAt; 19 | @property (strong, nonatomic) NSString *channelTitle; 20 | @property (strong, nonatomic) NSString *title; 21 | @property (strong, nonatomic) NSString *description; 22 | @property (strong, nonatomic) MABYT3_ResourceId *resourceId; 23 | @property (strong, nonatomic) NSString *channelId; 24 | @property (strong, nonatomic) NSMutableDictionary *thumbnails; 25 | 26 | - (id) initFromDictionary:(NSDictionary *)dict; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /YTAPI3/API/Subscription/MABYT3_SubscriptionSnippet.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_SubscriptionSnippet.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/subscriptions#snippet 6 | // 7 | // Created by Muhammad Bassio on 5/1/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_SubscriptionSnippet.h" 12 | 13 | @implementation MABYT3_SubscriptionSnippet 14 | 15 | @synthesize description = _description; 16 | 17 | - (id) init { 18 | 19 | self = [super init]; 20 | if (self) { 21 | _publishedAt = [[MAB_GDate alloc] init]; 22 | _channelTitle = @""; 23 | _title = @""; 24 | _description = @""; 25 | _resourceId = [[MABYT3_ResourceId alloc] init]; 26 | _channelId = @""; 27 | _thumbnails = [[NSMutableDictionary alloc] init]; 28 | } 29 | return self; 30 | } 31 | 32 | - (id) initFromDictionary:(NSDictionary *)dict { 33 | 34 | self = [super init]; 35 | if (self) { 36 | _publishedAt = [[MAB_GDate alloc] init]; 37 | _channelTitle = @""; 38 | _title = @""; 39 | _description = @""; 40 | _resourceId = [[MABYT3_ResourceId alloc] init]; 41 | _channelId = @""; 42 | _thumbnails = [[NSMutableDictionary alloc] init]; 43 | 44 | if ([dict objectForKey:@"publishedAt"]) { 45 | _publishedAt = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"publishedAt"]]; 46 | } 47 | if ([dict objectForKey:@"channelTitle"]) { 48 | _channelTitle = [dict objectForKey:@"channelTitle"]; 49 | } 50 | if ([dict objectForKey:@"title"]) { 51 | _title = [dict objectForKey:@"title"]; 52 | } 53 | if ([dict objectForKey:@"description"]) { 54 | _description = [dict objectForKey:@"description"]; 55 | } 56 | if ([dict objectForKey:@"resourceId"]) { 57 | _resourceId = [[MABYT3_ResourceId alloc] initFromDictionary:[dict objectForKey:@"resourceId"]]; 58 | } 59 | if ([dict objectForKey:@"channelId"]) { 60 | _channelId = [dict objectForKey:@"channelId"]; 61 | } 62 | 63 | if ([dict objectForKey:@"thumbnails"]) { 64 | NSDictionary *thmbDict = [dict objectForKey:@"thumbnails"]; 65 | NSArray *keys = [thmbDict allKeys]; 66 | for (int i = 0; i < keys.count; i++) { 67 | MABYT3_Thumbnail *thmb = [[MABYT3_Thumbnail alloc] initFromDictionary:[thmbDict objectForKey:keys[i]]]; 68 | [_thumbnails setObject:thmb forKey:keys[i]]; 69 | } 70 | } 71 | } 72 | return self; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_AudioStreams.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_AudioStreams.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_AudioStreams : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_AudioStreams.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_AudioStreams.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_AudioStreams.h" 10 | 11 | @implementation MABYT3_AudioStreams 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_Video.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Video.h 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/videos#properties 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import 12 | #import "MABYT3_VideoSnippet.h" 13 | #import "MABYT3_VideoContentDetails.h" 14 | #import "MABYT3_VideoStatistics.h" 15 | #import "MABYT3_VideoStatus.h" 16 | #import "MABYT3_VideoLiveStreamingDetails.h" 17 | 18 | @interface MABYT3_Video : NSObject 19 | 20 | @property (strong, nonatomic) NSString *kind; 21 | @property (strong, nonatomic) NSString *etag; 22 | @property (strong, nonatomic) NSString *identifier; 23 | @property (strong, nonatomic, readonly) MABYT3_VideoSnippet *snippet; 24 | @property (strong, nonatomic, readonly) MABYT3_VideoContentDetails *contentDetails; 25 | @property (strong, nonatomic, readonly) MABYT3_VideoStatistics *statistics; 26 | @property (strong, nonatomic, readonly) MABYT3_VideoStatus *status; 27 | @property (strong, nonatomic) NSString *embedHtml; 28 | 29 | @property (strong, nonatomic) MABYT3_VideoLiveStreamingDetails *liveStreamingDetails; 30 | 31 | - (id) initFromDictionary:(NSDictionary *)dict; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_Video.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_Video.m 3 | // YTAPI3Demo 4 | // 5 | // Full Details : https://developers.google.com/youtube/v3/docs/videos#properties 6 | // 7 | // Created by Muhammad Bassio on 5/3/14. 8 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 9 | // 10 | 11 | #import "MABYT3_Video.h" 12 | 13 | @implementation MABYT3_Video 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _kind = @"youtube#video"; 20 | _etag = @""; 21 | _identifier = @""; 22 | _snippet = [[MABYT3_VideoSnippet alloc] init]; 23 | _contentDetails = [[MABYT3_VideoContentDetails alloc] init]; 24 | _status = [[MABYT3_VideoStatus alloc] init]; 25 | _statistics = [[MABYT3_VideoStatistics alloc] init]; 26 | 27 | _embedHtml = @""; 28 | } 29 | return self; 30 | } 31 | 32 | - (id) initFromDictionary:(NSDictionary *)dict { 33 | 34 | self = [super init]; 35 | if (self) { 36 | _kind = @"youtube#video"; 37 | _etag = @""; 38 | _identifier = @""; 39 | _snippet = [[MABYT3_VideoSnippet alloc] init]; 40 | _contentDetails = [[MABYT3_VideoContentDetails alloc] init]; 41 | _status = [[MABYT3_VideoStatus alloc] init]; 42 | _statistics = [[MABYT3_VideoStatistics alloc] init]; 43 | 44 | _embedHtml = @""; 45 | 46 | if ([dict objectForKey:@"kind"]) { 47 | _kind = [dict objectForKey:@"kind"]; 48 | } 49 | if ([dict objectForKey:@"etag"]) { 50 | _etag = [dict objectForKey:@"etag"]; 51 | } 52 | if ([dict objectForKey:@"id"]) { 53 | _identifier = [dict objectForKey:@"id"]; 54 | } 55 | if ([dict objectForKey:@"snippet"]) { 56 | _snippet = [[MABYT3_VideoSnippet alloc] initFromDictionary:[dict objectForKey:@"snippet"]]; 57 | } 58 | if ([dict objectForKey:@"contentDetails"]) { 59 | _contentDetails = [[MABYT3_VideoContentDetails alloc] initFromDictionary:[dict objectForKey:@"contentDetails"]]; 60 | } 61 | if ([dict objectForKey:@"status"]) { 62 | _status = [[MABYT3_VideoStatus alloc] initFromDictionary:[dict objectForKey:@"status"]]; 63 | } 64 | if ([dict objectForKey:@"statistics"]) { 65 | _statistics = [[MABYT3_VideoStatistics alloc] initFromDictionary:[dict objectForKey:@"statistics"]]; 66 | } 67 | 68 | 69 | 70 | if ([dict objectForKey:@"player"]) { 71 | NSDictionary *dict2 = [dict objectForKey:@"player"]; 72 | if ([dict2 objectForKey:@"privacyStatus"]) { 73 | _embedHtml = [dict2 objectForKey:@"embedHtml"]; 74 | } 75 | } 76 | 77 | /* 78 | if ([dict objectForKey:@"liveStreamingDetails"]) { 79 | _liveStreamingDetails = [[MABYT3_VideoLiveStreamingDetails alloc] initFromDictionary:[dict objectForKey:@"liveStreamingDetails"]]; 80 | 81 | } 82 | */ 83 | 84 | } 85 | return self; 86 | } 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoContentDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoContentDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MABYT3_enums.h" 11 | #import "MABYT3_RegionRestriction.h" 12 | #import "MABYT3_ContentRating.h" 13 | 14 | @interface MABYT3_VideoContentDetails : NSObject 15 | 16 | @property (nonatomic) NSUInteger duration; 17 | @property (nonatomic) YTVideoDimension dimension; 18 | @property (nonatomic) YTVideoDefinition definition; 19 | @property (nonatomic) BOOL caption; 20 | @property (nonatomic) BOOL licensedContent; 21 | @property (strong, nonatomic) MABYT3_RegionRestriction *regionRestriction; 22 | @property (strong, nonatomic) MABYT3_ContentRating *contentRating; 23 | 24 | - (id) initFromDictionary:(NSDictionary *)dict; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoContentDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoContentDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoContentDetails.h" 10 | 11 | @implementation MABYT3_VideoContentDetails 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _duration = 0; 18 | _dimension = kYTVideoDimension2D; 19 | _definition = kYTVideoDefinitionSD; 20 | _caption = NO; 21 | _licensedContent = NO; 22 | _regionRestriction = [[MABYT3_RegionRestriction alloc] init]; 23 | _contentRating = [[MABYT3_ContentRating alloc] init]; 24 | } 25 | return self; 26 | } 27 | 28 | - (id) initFromDictionary:(NSDictionary *)dict { 29 | 30 | self = [super init]; 31 | if (self) { 32 | _duration = 0; 33 | _dimension = kYTVideoDimension2D; 34 | _definition = kYTVideoDefinitionSD; 35 | _caption = NO; 36 | _licensedContent = NO; 37 | _regionRestriction = [[MABYT3_RegionRestriction alloc] init]; 38 | _contentRating = [[MABYT3_ContentRating alloc] init]; 39 | 40 | if ([dict objectForKey:@"duration"]) { 41 | NSString *dur = [[[dict objectForKey:@"duration"] stringByReplacingOccurrencesOfString:@"PT" withString:@""] stringByReplacingOccurrencesOfString:@"S" withString:@""]; 42 | NSArray *arr = [dur componentsSeparatedByString:@"M"]; 43 | _duration = (60 * [arr[0] integerValue]) + [arr[1] integerValue]; 44 | } 45 | if ([dict objectForKey:@"dimension"]) { 46 | if ([[dict objectForKey:@"dimension"] isEqualToString:@"3d"]) { 47 | _dimension = kYTVideoDimension3D; 48 | } 49 | } 50 | if ([dict objectForKey:@"definition"]) { 51 | if ([[dict objectForKey:@"definition"] isEqualToString:@"hd"]) { 52 | _definition = kYTVideoDefinitionHD; 53 | } 54 | } 55 | if ([dict objectForKey:@"caption"]) { 56 | if ([[dict objectForKey:@"caption"] isEqualToString:@"true"]) { 57 | _caption = YES; 58 | } 59 | } 60 | if ([dict objectForKey:@"licensedContent"]) { 61 | _licensedContent = [[dict objectForKey:@"licensedContent"] boolValue]; 62 | } 63 | if ([dict objectForKey:@"regionRestriction"]) { 64 | _regionRestriction = [[MABYT3_RegionRestriction alloc] initFromDictionary:[dict objectForKey:@"regionRestriction"]]; 65 | } 66 | if ([dict objectForKey:@"contentRating"]) { 67 | _contentRating = [[MABYT3_ContentRating alloc] initFromDictionary:[dict objectForKey:@"contentRating"]]; 68 | } 69 | } 70 | return self; 71 | } 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoFileDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoFileDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_VideoFileDetails : NSObject 12 | 13 | 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoFileDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoFileDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoFileDetails.h" 10 | 11 | @implementation MABYT3_VideoFileDetails 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoLiveStreamingDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoLiveStreamingDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MAB_GDate.h" 11 | 12 | @interface MABYT3_VideoLiveStreamingDetails : NSObject 13 | 14 | @property (strong, nonatomic) MAB_GDate *actualStartTime; 15 | @property (strong, nonatomic) MAB_GDate *actualEndTime; 16 | @property (strong, nonatomic) MAB_GDate *scheduledStartTime; 17 | @property (strong, nonatomic) MAB_GDate *scheduledEndTime; 18 | @property (nonatomic) unsigned long concurrentViewers; 19 | 20 | - (id) initFromDictionary:(NSDictionary *)dict; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoLiveStreamingDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoLiveStreamingDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoLiveStreamingDetails.h" 10 | 11 | @implementation MABYT3_VideoLiveStreamingDetails 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _actualStartTime = [[MAB_GDate alloc] init]; 18 | _actualEndTime = [[MAB_GDate alloc] init]; 19 | _scheduledStartTime = [[MAB_GDate alloc] init]; 20 | _scheduledEndTime = [[MAB_GDate alloc] init]; 21 | _concurrentViewers = 0; 22 | } 23 | return self; 24 | } 25 | 26 | - (id) initFromDictionary:(NSDictionary *)dict { 27 | 28 | self = [super init]; 29 | if (self) { 30 | _actualStartTime = [[MAB_GDate alloc] init]; 31 | _actualEndTime = [[MAB_GDate alloc] init]; 32 | _scheduledStartTime = [[MAB_GDate alloc] init]; 33 | _scheduledEndTime = [[MAB_GDate alloc] init]; 34 | _concurrentViewers = 0; 35 | 36 | if ([dict objectForKey:@"actualStartTime"]) { 37 | _actualStartTime = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"actualStartTime"]]; 38 | } 39 | if ([dict objectForKey:@"actualEndTime"]) { 40 | _actualEndTime = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"actualEndTime"]]; 41 | } 42 | if ([dict objectForKey:@"scheduledStartTime"]) { 43 | _scheduledStartTime = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"scheduledStartTime"]]; 44 | } 45 | if ([dict objectForKey:@"scheduledEndTime"]) { 46 | _scheduledEndTime = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"scheduledEndTime"]]; 47 | } 48 | if ([dict objectForKey:@"concurrentViewers"]) { 49 | _concurrentViewers = [[dict objectForKey:@"concurrentViewers"] unsignedLongValue]; 50 | } 51 | 52 | } 53 | return self; 54 | } 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoProcessingDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoProcessingDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_VideoProcessingDetails : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoProcessingDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoProcessingDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoProcessingDetails.h" 10 | 11 | @implementation MABYT3_VideoProcessingDetails 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoProcessingProgress.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoProcessingProgress.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_VideoProcessingProgress : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoProcessingProgress.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoProcessingProgress.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoProcessingProgress.h" 10 | 11 | @implementation MABYT3_VideoProcessingProgress 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoRecordingDetails.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoRecordingDetails.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MABYT3_Location.h" 11 | #import "MAB_GDate.h" 12 | 13 | @interface MABYT3_VideoRecordingDetails : NSObject 14 | 15 | @property (strong, nonatomic) NSString *locationDescription; 16 | @property (strong, nonatomic) MABYT3_Location *location; 17 | @property (strong, nonatomic) MAB_GDate *recordingDate; 18 | 19 | - (id) initFromDictionary:(NSDictionary *)dict; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoRecordingDetails.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoRecordingDetails.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoRecordingDetails.h" 10 | 11 | @implementation MABYT3_VideoRecordingDetails 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _locationDescription = @""; 18 | _location = [[MABYT3_Location alloc] init]; 19 | _recordingDate = [[MAB_GDate alloc] init]; 20 | } 21 | return self; 22 | } 23 | 24 | - (id) initFromDictionary:(NSDictionary *)dict { 25 | 26 | self = [super init]; 27 | if (self) { 28 | _locationDescription = @""; 29 | _location = [[MABYT3_Location alloc] init]; 30 | _recordingDate = [[MAB_GDate alloc] init]; 31 | 32 | if ([dict objectForKey:@"locationDescription"]) { 33 | _locationDescription = [dict objectForKey:@"locationDescription"]; 34 | } 35 | if ([dict objectForKey:@"location"]) { 36 | _location = [[MABYT3_Location alloc] initFromDictionary:[dict objectForKey:@"location"]]; 37 | } 38 | if ([dict objectForKey:@"recordingDate"]) { 39 | _recordingDate = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"recordingDate"]]; 40 | } 41 | 42 | } 43 | return self; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoSnippet.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoSnippet.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MAB_GDate.h" 11 | #import "MABYT3_Thumbnail.h" 12 | #import "MABYT3_enums.h" 13 | 14 | @interface MABYT3_VideoSnippet : NSObject 15 | 16 | @property (strong, nonatomic) MAB_GDate *publishedAt; 17 | @property (strong, nonatomic) NSString *channelId; 18 | @property (strong, nonatomic) NSString *title; 19 | @property (strong, nonatomic) NSString *description; 20 | @property (strong, nonatomic) NSMutableDictionary *thumbnails; 21 | @property (strong, nonatomic) NSString *channelTitle; 22 | @property (strong, nonatomic) NSMutableArray *tags; 23 | @property (strong, nonatomic) NSString *categoryId; 24 | @property (nonatomic) YTLiveBroadcastContent liveBroadcastContent; 25 | 26 | - (id) initFromDictionary:(NSDictionary *)dict; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoSnippet.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoSnippet.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoSnippet.h" 10 | 11 | @implementation MABYT3_VideoSnippet 12 | 13 | @synthesize description = _description; 14 | 15 | - (id) init { 16 | 17 | self = [super init]; 18 | if (self) { 19 | _publishedAt = [[MAB_GDate alloc] init]; 20 | _channelId = @""; 21 | _title = @""; 22 | _description = @""; 23 | _thumbnails = [[NSMutableDictionary alloc] init]; 24 | _channelTitle = @""; 25 | _tags = [[NSMutableArray alloc] init]; 26 | _categoryId = @""; 27 | _liveBroadcastContent = kYTLiveBroadcastContentNone; 28 | } 29 | return self; 30 | } 31 | 32 | - (id) initFromDictionary:(NSDictionary *)dict { 33 | 34 | self = [super init]; 35 | if (self) { 36 | _publishedAt = [[MAB_GDate alloc] init]; 37 | _channelId = @""; 38 | _title = @""; 39 | _description = @""; 40 | _thumbnails = [[NSMutableDictionary alloc] init]; 41 | _channelTitle = @""; 42 | _tags = [[NSMutableArray alloc] init]; 43 | _categoryId = @""; 44 | _liveBroadcastContent = kYTLiveBroadcastContentNone; 45 | 46 | if ([dict objectForKey:@"publishedAt"]) { 47 | _publishedAt = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"publishedAt"]]; 48 | } 49 | if ([dict objectForKey:@"channelId"]) { 50 | _channelId = [dict objectForKey:@"channelId"]; 51 | } 52 | if ([dict objectForKey:@"title"]) { 53 | _title = [dict objectForKey:@"title"]; 54 | } 55 | if ([dict objectForKey:@"description"]) { 56 | _description = [dict objectForKey:@"description"]; 57 | } 58 | if ([dict objectForKey:@"channelTitle"]) { 59 | _channelTitle = [dict objectForKey:@"channelTitle"]; 60 | } 61 | if ([dict objectForKey:@"tags"]) { 62 | _tags = [[dict objectForKey:@"tags"] mutableCopy]; 63 | } 64 | if ([dict objectForKey:@"categoryId"]) { 65 | _categoryId = [dict objectForKey:@"categoryId"]; 66 | } 67 | if ([dict objectForKey:@"liveBroadcastContent"]) { 68 | _liveBroadcastContent = [self liveBroadcastContentFromString:[dict objectForKey:@"liveBroadcastContent"]]; 69 | } 70 | 71 | if ([dict objectForKey:@"thumbnails"]) { 72 | NSDictionary *thmbDict = [dict objectForKey:@"thumbnails"]; 73 | NSArray *keys = [thmbDict allKeys]; 74 | for (int i = 0; i < keys.count; i++) { 75 | MABYT3_Thumbnail *thmb = [[MABYT3_Thumbnail alloc] initFromDictionary:[thmbDict objectForKey:keys[i]]]; 76 | [_thumbnails setObject:thmb forKey:keys[i]]; 77 | } 78 | } 79 | } 80 | return self; 81 | } 82 | 83 | - (YTLiveBroadcastContent) liveBroadcastContentFromString:(NSString *)prvString { 84 | 85 | YTLiveBroadcastContent retVal = kYTLiveBroadcastContentNone; 86 | 87 | if ([prvString isEqualToString:@"upcoming"]) { 88 | retVal = kYTLiveBroadcastContentUpcoming; 89 | } 90 | else if ([prvString isEqualToString:@"live"]) { 91 | retVal = kYTLiveBroadcastContentLive; 92 | } 93 | return retVal; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoStatistics.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoStatistics.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_VideoStatistics : NSObject 12 | 13 | @property (nonatomic) unsigned long viewCount; 14 | @property (nonatomic) unsigned long likeCount; 15 | @property (nonatomic) unsigned long dislikeCount; 16 | @property (nonatomic) unsigned long favoriteCount; 17 | @property (nonatomic) unsigned long commentCount; 18 | 19 | - (id) initFromDictionary:(NSDictionary *)dict; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoStatistics.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoStatistics.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoStatistics.h" 10 | 11 | @implementation MABYT3_VideoStatistics 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _viewCount = 0; 18 | _likeCount = 0; 19 | _dislikeCount = 0; 20 | _favoriteCount = 0; 21 | _commentCount = 0; 22 | } 23 | return self; 24 | } 25 | 26 | - (id) initFromDictionary:(NSDictionary *)dict { 27 | 28 | self = [super init]; 29 | if (self) { 30 | _viewCount = 0; 31 | _likeCount = 0; 32 | _dislikeCount = 0; 33 | _favoriteCount = 0; 34 | _commentCount = 0; 35 | 36 | if ([dict objectForKey:@"viewCount"]) { 37 | _viewCount = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"viewCount"]] unsignedLongValue]; 38 | } 39 | if ([dict objectForKey:@"likeCount"]) { 40 | _likeCount = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"likeCount"]] unsignedLongValue]; 41 | } 42 | if ([dict objectForKey:@"dislikeCount"]) { 43 | _dislikeCount = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"dislikeCount"]] unsignedLongValue]; 44 | } 45 | if ([dict objectForKey:@"favoriteCount"]) { 46 | _favoriteCount = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"favoriteCount"]] unsignedLongValue]; 47 | } 48 | if ([dict objectForKey:@"commentCount"]) { 49 | _commentCount = [[[[NSNumberFormatter alloc] init] numberFromString:[dict objectForKey:@"commentCount"]] unsignedLongValue]; 50 | } 51 | } 52 | return self; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoStatus.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoStatus.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MAB_GDate.h" 11 | #import "MABYT3_enums.h" 12 | 13 | @interface MABYT3_VideoStatus : NSObject 14 | 15 | @property (strong, nonatomic) NSString *uploadStatus; 16 | @property (strong, nonatomic) NSString *failureReason; 17 | @property (strong, nonatomic) NSString *rejectionReason; 18 | @property (nonatomic) YTPrivacyStatus privacyStatus; 19 | @property (strong, nonatomic) MAB_GDate *publishedAt; 20 | @property (nonatomic) YTVideoLicense license; 21 | @property (nonatomic) BOOL embeddable; 22 | @property (nonatomic) BOOL publicStatsViewable; 23 | 24 | - (id) initFromDictionary:(NSDictionary *)dict; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoStatus.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoStatus.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoStatus.h" 10 | 11 | @implementation MABYT3_VideoStatus 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _uploadStatus = @"processed"; 18 | _failureReason = @""; 19 | _rejectionReason = @""; 20 | _privacyStatus = kYTPrivacyStatusPrivate; 21 | _publishedAt = [[MAB_GDate alloc] init]; 22 | _license = kYTVideoLicenseYT; 23 | _embeddable = YES; 24 | _publicStatsViewable = YES; 25 | } 26 | return self; 27 | } 28 | 29 | - (id) initFromDictionary:(NSDictionary *)dict { 30 | 31 | self = [super init]; 32 | if (self) { 33 | _uploadStatus = @"processed"; 34 | _failureReason = @""; 35 | _rejectionReason = @""; 36 | _privacyStatus = kYTPrivacyStatusPrivate; 37 | _publishedAt = [[MAB_GDate alloc] init]; 38 | _license = kYTVideoLicenseYT; 39 | _embeddable = YES; 40 | _publicStatsViewable = YES; 41 | 42 | if ([dict objectForKey:@"uploadStatus"]) { 43 | _uploadStatus = [dict objectForKey:@"uploadStatus"]; 44 | } 45 | if ([dict objectForKey:@"failureReason"]) { 46 | _failureReason = [dict objectForKey:@"failureReason"]; 47 | } 48 | if ([dict objectForKey:@"rejectionReason"]) { 49 | _rejectionReason = [dict objectForKey:@"rejectionReason"]; 50 | } 51 | if ([dict objectForKey:@"privacyStatus"]) { 52 | _privacyStatus = [self privacyStatusFromString:[dict objectForKey:@"privacyStatus"]]; 53 | } 54 | if ([dict objectForKey:@"publishedAt"]) { 55 | _publishedAt = [[MAB_GDate alloc] initFromString:[dict objectForKey:@"publishedAt"]]; 56 | } 57 | if ([dict objectForKey:@"embeddable"]) { 58 | _embeddable = [[dict objectForKey:@"embeddable"] boolValue]; 59 | } 60 | if ([dict objectForKey:@"publicStatsViewable"]) { 61 | _publicStatsViewable = [[dict objectForKey:@"publicStatsViewable"] boolValue]; 62 | } 63 | 64 | } 65 | return self; 66 | } 67 | 68 | - (YTPrivacyStatus) privacyStatusFromString:(NSString *)prvString { 69 | 70 | YTPrivacyStatus retVal = kYTPrivacyStatusPublic; 71 | 72 | if ([prvString isEqualToString:@"private"]) { 73 | retVal = kYTPrivacyStatusPrivate; 74 | } 75 | else if ([prvString isEqualToString:@"unlisted"]) { 76 | retVal = kYTPrivacyStatusUnlisted; 77 | } 78 | return retVal; 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoStreams.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoStreams.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_VideoStreams : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoStreams.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoStreams.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoStreams.h" 10 | 11 | @implementation MABYT3_VideoStreams 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoSuggestions.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoSuggestions.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_VideoSuggestions : NSObject 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/API/Video/MABYT3_VideoSuggestions.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_VideoSuggestions.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 5/3/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_VideoSuggestions.h" 10 | 11 | @implementation MABYT3_VideoSuggestions 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /YTAPI3/OAuthFrameWork/MAB_GoogleAccessToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // MAB_GoogleAccessToken.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MAB_GoogleAccessToken : NSObject 12 | 13 | @property (strong, nonatomic) NSString *accessToken; 14 | @property (strong, nonatomic) NSString *tokenType; 15 | @property (nonatomic) NSUInteger expiresIn; 16 | @property (strong, nonatomic) NSString *refreshToken; 17 | @property (strong, nonatomic) NSDate *tokenTime; 18 | 19 | - (id) initFromDictionary:(NSDictionary *)textdict; 20 | - (void) refreshToken:(NSDictionary *)textdict; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /YTAPI3/OAuthFrameWork/MAB_GoogleAccessToken.m: -------------------------------------------------------------------------------- 1 | // 2 | // MAB_GoogleAccessToken.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MAB_GoogleAccessToken.h" 10 | 11 | @implementation MAB_GoogleAccessToken 12 | 13 | - (id) init { 14 | 15 | self = [super init]; 16 | if (self) { 17 | _accessToken = @""; 18 | _tokenType = @""; 19 | _expiresIn = 0; 20 | _refreshToken = @""; 21 | _tokenTime = [NSDate date]; 22 | } 23 | return self; 24 | } 25 | 26 | - (id) initFromDictionary:(NSDictionary *)textdict { 27 | 28 | self = [super init]; 29 | if (self) { 30 | _accessToken = @""; 31 | _tokenType = @""; 32 | _expiresIn = 0; 33 | _refreshToken = @""; 34 | _tokenTime = [NSDate date]; 35 | 36 | if ([textdict objectForKey:@"access_token"]) { 37 | _accessToken = [textdict objectForKey:@"access_token"]; 38 | } 39 | if ([textdict objectForKey:@"token_type"]) { 40 | _tokenType = [textdict objectForKey:@"token_type"]; 41 | } 42 | if ([textdict objectForKey:@"expires_in"]) { 43 | _expiresIn = [[textdict objectForKey:@"expires_in"] integerValue]; 44 | } 45 | if ([textdict objectForKey:@"refresh_token"]) { 46 | _refreshToken = [textdict objectForKey:@"refresh_token"]; 47 | } 48 | 49 | } 50 | return self; 51 | } 52 | 53 | - (void) refreshToken:(NSDictionary *)textdict { 54 | 55 | if ([textdict objectForKey:@"access_token"]) { 56 | _accessToken = [textdict objectForKey:@"access_token"]; 57 | } 58 | if ([textdict objectForKey:@"token_type"]) { 59 | _tokenType = [textdict objectForKey:@"token_type"]; 60 | } 61 | if ([textdict objectForKey:@"expires_in"]) { 62 | _expiresIn = [[textdict objectForKey:@"expires_in"] integerValue]; 63 | } 64 | 65 | } 66 | 67 | 68 | - (void)encodeWithCoder:(NSCoder *)encoder { 69 | //Encode properties, other class variables, etc 70 | [encoder encodeObject:_accessToken forKey:@"atoken"]; 71 | [encoder encodeObject:_tokenType forKey:@"tokentype"]; 72 | [encoder encodeObject:[NSNumber numberWithInteger:_expiresIn] forKey:@"expiresin"]; 73 | [encoder encodeObject:_refreshToken forKey:@"rtoken"]; 74 | [encoder encodeObject:_tokenTime forKey:@"tokentime"]; 75 | 76 | } 77 | 78 | - (id)initWithCoder:(NSCoder *)decoder { 79 | if((self = [super init])) { 80 | //decode properties, other class vars 81 | _accessToken = [decoder decodeObjectForKey:@"atoken"]; 82 | _tokenType = [decoder decodeObjectForKey:@"tokentype"]; 83 | _expiresIn = [[decoder decodeObjectForKey:@"expiresin"] integerValue]; 84 | _refreshToken = [decoder decodeObjectForKey:@"rtoken"]; 85 | _tokenTime = [decoder decodeObjectForKey:@"tokentime"]; 86 | } 87 | return self; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /YTAPI3/OAuthFrameWork/MAB_GoogleOAuthTouchViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MAB_GoogleOAuthTouchViewController.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "MAB_GoogleAccessToken.h" 12 | #import "MAB_GoogleUserCredentials.h" 13 | 14 | @interface MAB_GoogleOAuthTouchViewController : UIViewController 15 | { 16 | UIWebView *webview; 17 | UINavigationBar *navBar; 18 | UIButton *cancelBtn; 19 | UIActivityIndicatorView *loading; 20 | 21 | BOOL isVerified; 22 | NSString *urlstring; 23 | NSInteger navy; 24 | NSString *stoken; 25 | 26 | } 27 | 28 | @property (weak, nonatomic) NSString *clientID; 29 | @property (weak, nonatomic) NSString *clientSecret; 30 | @property (weak, nonatomic) NSString *scope; 31 | //@property (strong, nonatomic) MAB_GoogleAccessToken *token; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /YTAPI3/OAuthFrameWork/MAB_GoogleUserCredentials.h: -------------------------------------------------------------------------------- 1 | // 2 | // MAB_GoogleUserCredentials.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MAB_GoogleAccessToken.h" 11 | #import "MABYT3_Channel.h" 12 | #import "MABYT3_Subscription.h" 13 | 14 | 15 | #define IsPad (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPhone) 16 | 17 | #define UIColorFromRGBA(rgbValue, alphaValue) [UIColor colorWithRed:((CGFloat)((rgbValue & 0xFF0000) >> 16))/255.0 green:((CGFloat)((rgbValue & 0xFF00) >> 8))/255.0 blue:((CGFloat)(rgbValue & 0xFF))/255.0 alpha:alphaValue] 18 | 19 | #define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) 20 | #define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) 21 | #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) 22 | #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) 23 | #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) 24 | 25 | #pragma message "You have to register your app at https://console.developers.google.com/ to get ClientID, Client secret & apiKey" 26 | 27 | static NSString *kMyClientID = @"___"; 28 | static NSString *kMyClientSecret = @"___"; 29 | static NSString *apiKey = @"___"; 30 | static NSString *scope = @"https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtube.readonly https://www.googleapis.com/auth/youtubepartner https://www.googleapis.com/auth/youtubepartner-channel-audit https://www.googleapis.com/auth/youtube.upload"; 31 | 32 | 33 | 34 | @protocol MAB_GoogleUserCredentialsDelegate 35 | 36 | - (void) CredUserNoChannel; 37 | - (void) CredUserUpdated; 38 | - (void) CredUserPrepare; 39 | - (void) CredUserSubsComplete; 40 | 41 | @optional 42 | - (void) ChooseChannel:(NSMutableArray *)channels; 43 | 44 | @end 45 | 46 | 47 | @interface MAB_GoogleUserCredentials : NSObject 48 | { 49 | BOOL userFetched; 50 | NSString *nxtSubURL; 51 | } 52 | 53 | @property (nonatomic) BOOL signedin; 54 | @property (strong, nonatomic) MAB_GoogleAccessToken *token; 55 | @property (strong, nonatomic) MABYT3_Channel *user; 56 | @property (strong, nonatomic) NSMutableArray *ytSubs; 57 | @property (weak, nonatomic) id delegate; 58 | 59 | 60 | + (MAB_GoogleUserCredentials *) sharedInstance; 61 | - (void) saveToken; 62 | - (void) initUser; 63 | - (void) SignOut; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /YTAPI3Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /YTAPI3Demo.xcodeproj/xcuserdata/muhammadbassio.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /YTAPI3Demo.xcodeproj/xcuserdata/muhammadbassio.xcuserdatad/xcschemes/YTAPI3Demo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /YTAPI3Demo.xcodeproj/xcuserdata/muhammadbassio.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | YTAPI3Demo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8EB1306A191164D100FD4FFB 16 | 17 | primary 18 | 19 | 20 | 8EB1308B191164D100FD4FFB 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /YTAPI3Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /YTAPI3Demo/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /YTAPI3Demo/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /YTAPI3Demo/MABYT3_AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_AppDelegate.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MABYT3_AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /YTAPI3Demo/MABYT3_AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_AppDelegate.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_AppDelegate.h" 10 | 11 | @implementation MABYT3_AppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /YTAPI3Demo/MABYT3_ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ViewController.h 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MAB_GoogleOAuthTouchViewController.h" 11 | #import "MABYT3_APIRequest.h" 12 | 13 | @interface MABYT3_ViewController : UIViewController 14 | { 15 | UIButton *si; 16 | UIButton *so; 17 | } 18 | @end 19 | -------------------------------------------------------------------------------- /YTAPI3Demo/MABYT3_ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MABYT3_ViewController.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import "MABYT3_ViewController.h" 10 | 11 | @interface MABYT3_ViewController () 12 | 13 | @end 14 | 15 | 16 | 17 | @implementation MABYT3_ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | 23 | si = [[UIButton alloc] initWithFrame:CGRectMake(20, 60, 100, 50)]; 24 | si.backgroundColor = [UIColor redColor]; 25 | [si setTitle:@"signIn" forState:UIControlStateNormal]; 26 | [si addTarget:self action:@selector(signIn) forControlEvents:UIControlEventTouchUpInside]; 27 | [self.view addSubview:si]; 28 | 29 | so = [[UIButton alloc] initWithFrame:CGRectMake(20, 60, 100, 50)]; 30 | so.backgroundColor = [UIColor redColor]; 31 | [so setTitle:@"signOut" forState:UIControlStateNormal]; 32 | [so addTarget:self action:@selector(signOut) forControlEvents:UIControlEventTouchUpInside]; 33 | [self.view addSubview:so]; 34 | 35 | [MAB_GoogleUserCredentials sharedInstance].delegate = self; 36 | 37 | if ([MAB_GoogleUserCredentials sharedInstance].signedin) { 38 | si.hidden = YES; 39 | so.hidden = NO; 40 | } 41 | else { 42 | si.hidden = NO; 43 | so.hidden = YES; 44 | } 45 | } 46 | 47 | - (void)didReceiveMemoryWarning { 48 | 49 | [super didReceiveMemoryWarning]; 50 | // Dispose of any resources that can be recreated. 51 | } 52 | 53 | 54 | 55 | - (void) signIn { 56 | 57 | MAB_GoogleOAuthTouchViewController *signInVC = [[MAB_GoogleOAuthTouchViewController alloc] init]; 58 | signInVC.scope = scope; 59 | signInVC.clientID = kMyClientID; 60 | signInVC.clientSecret = kMyClientSecret; 61 | [self presentViewController:signInVC animated:YES completion:^{ 62 | 63 | }]; 64 | 65 | } 66 | 67 | - (void) signOut { 68 | 69 | [[MAB_GoogleUserCredentials sharedInstance] SignOut]; 70 | si.hidden = NO; 71 | so.hidden = YES; 72 | } 73 | 74 | 75 | - (void) CredUserNoChannel { 76 | NSLog(@"No Channel !"); 77 | } 78 | 79 | - (void) CredUserUpdated { 80 | NSLog(@"User data loaded :)"); 81 | si.hidden = YES; 82 | so.hidden = NO; 83 | } 84 | 85 | - (void) CredUserPrepare { 86 | NSLog(@"fetching user data ..."); 87 | } 88 | 89 | - (void) CredUserSubsComplete { 90 | 91 | [[MABYT3_APIRequest sharedInstance] LISTActivitiesForURL:[[MABYT3_APIRequest sharedInstance] ActivitiesURLforHomeWithMaxResults:50] andHandler:^(NSMutableArray *results, NSError *error, NSString *nxt) { 92 | 93 | if (!error) { 94 | NSLog(@"%@", [@(results.count) stringValue]); 95 | } 96 | else { 97 | NSLog(@"%@", error.description); 98 | } 99 | }]; 100 | 101 | } 102 | 103 | 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /YTAPI3Demo/YTAPI3Demo-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.muhammadbassio.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /YTAPI3Demo/YTAPI3Demo-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | 18 | 19 | #ifdef DEBUG 20 | # define NSLog(...) NSLog(__VA_ARGS__) 21 | #else 22 | # define NSLog(...) 23 | #endif 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /YTAPI3Demo/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /YTAPI3Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // YTAPI3Demo 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "MABYT3_AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([MABYT3_AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /YTAPI3DemoTests/YTAPI3DemoTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.muhammadbassio.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /YTAPI3DemoTests/YTAPI3DemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // YTAPI3DemoTests.m 3 | // YTAPI3DemoTests 4 | // 5 | // Created by Muhammad Bassio on 4/30/14. 6 | // Copyright (c) 2014 Muhammad Bassio. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YTAPI3DemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation YTAPI3DemoTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /YTAPI3DemoTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------