common/: Use socket.url
[libquvi-scripts.git] / tests / media / media_youtube.c
blob13f2ee6271e3c48c449454394c4cd0360b0ba341
1 /* libquvi-scripts
2 * Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301 USA
20 #include "config.h"
22 #include <string.h>
23 #include <glib.h>
24 #include <quvi.h>
26 #include "tests.h"
28 static const gchar URL[] =
29 "http://www.youtube.com/watch?v=G4evlxq34og#t=1m09s";
31 static const gchar TITLE[] =
32 "Hal-5";
34 static const gchar ID[] =
35 "G4evlxq34og";
37 static void test_media_youtube()
39 struct qm_test_exact_s e;
40 struct qm_test_opts_s o;
42 memset(&e, 0, sizeof(e));
43 memset(&o, 0, sizeof(o));
45 e.title = TITLE;
46 e.id = ID;
48 /* String values. */
50 #ifdef _1
51 /* These are available to only some of the formats. Skip these. */
52 o.s_len_gt0.stream.video.encoding = TRUE;
53 o.s_len_gt0.stream.audio.encoding = TRUE;
54 #endif
55 o.s_len_gt0.stream.container = TRUE;
57 /* Numerical values. */
59 o.gt0.stream.video.height = TRUE;
60 o.gt0.stream.video.width = TRUE;
62 o.gt0.start_time_ms = TRUE; /* The URL above specifies the #t= parameter. */
63 o.gt0.duration_ms = TRUE;
65 qm_test(__func__, URL, &e, &o);
68 gint main(gint argc, gchar **argv)
70 g_test_init(&argc, &argv, NULL);
71 g_test_add_func("/media/youtube", test_media_youtube);
72 return (g_test_run());
75 /* vim: set ts=2 sw=2 tw=72 expandtab: */