Skip to content

Commit 05bc2e7

Browse files
committed
Added some mapping fields and also add verbosity to test class
1 parent c207746 commit 05bc2e7

3 files changed

Lines changed: 60 additions & 10 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.sapher</groupId>
88
<artifactId>youtubedl</artifactId>
9-
<version>1.2</version>
9+
<version>1.2.1</version>
1010
<packaging>jar</packaging>
1111

1212
<name>YoutubeDL wrapper</name>

src/main/java/com/sapher/youtubedl/mapper/VideoInfo.java

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,47 @@ public class VideoInfo {
3535
@JsonProperty("uploader_id")
3636
public String uploaderId;
3737
public String uploader;
38+
39+
@JsonProperty("channel_url")
40+
public String channelUrl;
41+
42+
@JsonProperty("channel_id")
43+
public String channelId;
44+
45+
@JsonProperty("uploader_url")
46+
public String uploaderUrl;
47+
48+
public String track;
49+
public String playlist;
50+
@JsonProperty("playlist_index")
51+
public String playlistIndex;
52+
@JsonProperty("episode_number")
53+
public String episodeNumber;
54+
@JsonProperty("season_number")
55+
public String seasonNumber;
56+
57+
@JsonProperty("is_live")
58+
public String isLive;
59+
public String series;
60+
61+
@JsonProperty("release_date")
62+
public String releaseDate;
63+
@JsonProperty("release_year")
64+
public String releaseYear;
65+
66+
67+
@JsonProperty("scan_date")
68+
public String scanDate;
69+
70+
public String creator;
71+
public String artist;
72+
@JsonProperty("alt_title")
73+
public String altTitle;
74+
@JsonProperty("extractor_key")
75+
public String extractorKey;
76+
public String chapters;
77+
public String album;
78+
3879

3980
@JsonProperty("player_url")
4081
public String playerUrl;
@@ -102,16 +143,23 @@ public String getUploader() {
102143
}
103144
@Override
104145
public String toString() {
105-
return "VideoInfo [id=" + id + ", fulltitle=" + fulltitle + ", title=" + title + ", uploadDate=" + uploadDate
106-
+ ", displayId=" + displayId + ", duration=" + duration + ", description=" + description
107-
+ ", thumbnail=" + thumbnail + ", license=" + license + ", viewCount=" + viewCount + ", likeCount="
108-
+ likeCount + ", dislikeCount=" + dislikeCount + ", repostCount=" + repostCount + ", averageRating="
109-
+ averageRating + ", uploaderId=" + uploaderId + ", uploader=" + uploader + ", playerUrl=" + playerUrl
110-
+ ", webpageUrl=" + webpageUrl + ", webpageUrlBasename=" + webpageUrlBasename + ", resolution="
111-
+ resolution + ", width=" + width + ", height=" + height + ", format=" + format + ", ext=" + ext
112-
+ ", httpHeader=" + httpHeader + ", categories=" + categories + ", tags=" + tags + ", formats="
113-
+ formats + ", thumbnails=" + thumbnails + "]";
146+
return "VideoInfo [id=" + id + "\n, fulltitle=" + fulltitle + "\n, title=" + title + "\n, uploadDate=" + uploadDate
147+
+ "\n, displayId=" + displayId + "\n, duration=" + duration + "\n, description=" + description
148+
+ "\n, thumbnail=" + thumbnail + "\n, license=" + license + "\n, viewCount=" + viewCount + "\n, likeCount="
149+
+ likeCount + "\n, dislikeCount=" + dislikeCount + "\n, repostCount=" + repostCount + "\n, averageRating="
150+
+ averageRating + "\n, uploaderId=" + uploaderId + "\n, uploader=" + uploader + "\n, channelUrl=" + channelUrl
151+
+ "\n, channelId=" + channelId + "\n, uploaderUrl=" + uploaderUrl + "\n, track=" + track + "\n, playlist="
152+
+ playlist + "\n, playlistIndex=" + playlistIndex + "\n, episodeNumber=" + episodeNumber + "\n, seasonNumber="
153+
+ seasonNumber + "\n, isLive=" + isLive + "\n, series=" + series + "\n, releaseDate=" + releaseDate
154+
+ "\n, releaseYear=" + releaseYear + "\n, scanDate=" + scanDate + "\n, creator=" + creator + "\n, artist="
155+
+ artist + "\n, altTitle=" + altTitle + "\n, extractorKey=" + extractorKey + "\n, chapters=" + chapters
156+
+ "\n, album=" + album + "\n, playerUrl=" + playerUrl + "\n, webpageUrl=" + webpageUrl
157+
+ "\n, webpageUrlBasename=" + webpageUrlBasename + "\n, resolution=" + resolution + "\n, width=" + width
158+
+ "\n, height=" + height + "\n, format=" + format + "\n, ext=" + ext + "\n, httpHeader=" + httpHeader
159+
+ "\n, categories=" + categories + "\n, tags=" + tags + "\n, formats=" + formats + "\n, thumbnails="
160+
+ thumbnails + "]";
114161
}
115162

116163

164+
117165
}

src/test/java/com/sapher/youtubedl/YoutubeDLTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ public void testGetVideoInfoInDetails() throws YoutubeDLException {
8787
Assert.assertNotNull(videoInfo.getLikeCount());
8888
Assert.assertNotNull(videoInfo.getDislikeCount());
8989
Assert.assertNotNull(videoInfo.getAverageRating());
90+
//Let's print the whole object
91+
System.out.println("videoInfo:"+videoInfo.toString());
9092

9193

9294
}

0 commit comments

Comments
 (0)