Skip to content

Commit 67794e5

Browse files
committed
v5 to v6
1 parent 5957734 commit 67794e5

File tree

11 files changed

+31
-31
lines changed

11 files changed

+31
-31
lines changed

lib/yt_search_web/router.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule YtSearchWeb.Router do
99
pipe_through :api
1010
end
1111

12-
scope "/api/v5", YtSearchWeb do
12+
scope "/api/v6", YtSearchWeb do
1313
get("/search", SearchController, :search_by_text)
1414
get("/search/:id", SearchController, :search_by_id)
1515
get("/c/:channel_slot_id", SearchController, :fetch_channel)
@@ -29,7 +29,7 @@ defmodule YtSearchWeb.Router do
2929
# - quest vrchat keyboard not having a cursor you can click on
3030
# - quest vrchat keyboard not actually scrolling properly when link is too long
3131
# - world url map has less bytes per url, which helps on overall world size
32-
scope "/a/5", YtSearchWeb do
32+
scope "/a/6", YtSearchWeb do
3333
get("/s", SearchController, :search_by_text)
3434
get("/c/:channel_slot_id", SearchController, :fetch_channel)
3535
get("/p/:playlist_slot_id", SearchController, :fetch_playlist)

test/scripts/manual_smoke_test.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -eux
55
HOST=$1
66
search_param=${2:-"urban+rescue+ranch"}
77

8-
hello_results=$(curl -A 'UnityWebRequest' -v "http://$HOST/api/v5/hello/smoke_test")
8+
hello_results=$(curl -A 'UnityWebRequest' -v "http://$HOST/api/v6/hello/smoke_test")
99
printf "%s" "$hello_results"
1010
is_online=$(printf "%s" "$hello_results" | jq -r .online)
1111
if [ "$is_online" != "true" ]; then
@@ -19,25 +19,25 @@ trending_tab_slot_id=$(printf "%s" "$hello_results" | jq -r '.trending_tab.searc
1919
check_slot(){
2020
slot_id=$1
2121

22-
quest_request=$(curl -w '%{http_code}' -o /dev/null -A 'stagefright' "http://$HOST/a/5/sl/$slot_id")
22+
quest_request=$(curl -w '%{http_code}' -o /dev/null -A 'stagefright' "http://$HOST/a/6/sl/$slot_id")
2323
if [ "$quest_request" != "302" ]; then
2424
echo "expected 302, got $quest_request"
2525
exit 1
2626
fi
2727

28-
redirect_request=$(curl -w '%{http_code}' -o /dev/null -A 'stagefright' "http://$HOST/a/5/sr/$slot_id")
28+
redirect_request=$(curl -w '%{http_code}' -o /dev/null -A 'stagefright' "http://$HOST/a/6/sr/$slot_id")
2929
if [ "$redirect_request" != "302" ]; then
3030
echo "expected 302, got $redirect_request"
3131
exit 1
3232
fi
3333

34-
unity_request=$(curl -w '%{http_code}' -o /dev/null -A 'UnityWebRequest' "http://$HOST/a/5/sr/$slot_id")
34+
unity_request=$(curl -w '%{http_code}' -o /dev/null -A 'UnityWebRequest' "http://$HOST/a/6/sr/$slot_id")
3535
if [ "$unity_request" != "200" ]; then
3636
echo "expected 200, got $unity_request"
3737
exit 1
3838
fi
3939

40-
any_request=$(curl -w '%{http_code}' -o /dev/null "http://$HOST/a/5/sl/$slot_id")
40+
any_request=$(curl -w '%{http_code}' -o /dev/null "http://$HOST/a/6/sl/$slot_id")
4141
if [ "$any_request" != "302" ]; then
4242
echo "expected 302, got $any_request"
4343
exit 1
@@ -49,9 +49,9 @@ check_slot "$trending_tab_slot_id"
4949
# check search
5050

5151
sleep 4
52-
result=$(curl -A 'UnityWebRequest' -v -G "http://$HOST/a/5/s" --data-urlencode "q=$search_param")
52+
result=$(curl -A 'UnityWebRequest' -v -G "http://$HOST/a/6/s" --data-urlencode "q=$search_param")
5353
search_slot_id=$(echo "$result" | jq -r '.slot_id' | head -n 1)
54-
atlas_status_code=$(curl -w '%{http_code}' -o /dev/null -v -G "http://$HOST/a/5/at/$search_slot_id")
54+
atlas_status_code=$(curl -w '%{http_code}' -o /dev/null -v -G "http://$HOST/a/6/at/$search_slot_id")
5555
if [ "$atlas_status_code" != "200" ]; then
5656
echo "expected 200 from atlas, got $atlas_status_code"
5757
exit 1
@@ -63,7 +63,7 @@ echo "got slot $first_video_slot_id"
6363
check_slot "$first_video_slot_id"
6464

6565
nextpage_slot_id=$(echo "$result" | jq -r '.nextpage_slot_id')
66-
nextpage_result=$(curl -A 'UnityWebRequest' -v -G "http://$HOST/a/5/r/$nextpage_slot_id")
66+
nextpage_result=$(curl -A 'UnityWebRequest' -v -G "http://$HOST/a/6/r/$nextpage_slot_id")
6767

6868
nextpage_video_slot_id=$(echo "$nextpage_result" | jq -r '.search_results[] | select(.type == "video") | .slot_id' | head -n 1)
6969
echo "got video slot from nextpage $nextpage_video_slot_id"

test/yt_search_web/controllers/hello_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ defmodule YtSearchWeb.HelloTest do
2323

2424
conn =
2525
conn
26-
|> get(~p"/api/v5/hello")
26+
|> get(~p"/api/v6/hello")
2727

2828
resp_json = json_response(conn, 200)
2929
assert resp_json["online"] == true

test/yt_search_web/controllers/search_batch_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ defmodule YtSearchWeb.SearchBatchTest do
2727
conn =
2828
conn
2929
|> put_req_header("user-agent", "UnityWebRequest")
30-
|> get(~p"/api/v5/search?search=whatever")
30+
|> get(~p"/api/v6/search?search=whatever")
3131

3232
json_response(conn, 200)
3333
end

test/yt_search_web/controllers/search_test.exs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ defmodule YtSearchWeb.SearchTest do
176176
conn =
177177
conn
178178
|> put_req_header("user-agent", "UnityWebRequest")
179-
|> get(~p"/api/v5/search?search=urban+rescue+ranch")
179+
|> get(~p"/api/v6/search?search=urban+rescue+ranch")
180180

181181
resp_json = json_response(conn, 200)
182182
verify_search_results(resp_json)
@@ -185,7 +185,7 @@ defmodule YtSearchWeb.SearchTest do
185185

186186
conn =
187187
conn
188-
|> get("/api/v5/s/#{second_slot_id}")
188+
|> get("/api/v6/s/#{second_slot_id}")
189189

190190
assert get_resp_header(conn, "location") == ["https://youtube.com/watch?v=ClEcGfH1250"]
191191

@@ -353,7 +353,7 @@ defmodule YtSearchWeb.SearchTest do
353353
conn =
354354
conn
355355
|> put_req_header("user-agent", "UnityWebRequest")
356-
|> get(~p"/api/v5/search?search=whatever")
356+
|> get(~p"/api/v6/search?search=whatever")
357357

358358
rjson = json_response(conn, 200)
359359
first_result = rjson["search_results"] |> Enum.at(0)
@@ -375,7 +375,7 @@ defmodule YtSearchWeb.SearchTest do
375375
conn =
376376
build_conn()
377377
|> put_req_header("user-agent", "UnityWebRequest")
378-
|> get(~p"/api/v5/search?search=whatever")
378+
|> get(~p"/api/v6/search?search=whatever")
379379

380380
rjson = json_response(conn, 200)
381381
first_result = rjson["search_results"] |> Enum.at(0)
@@ -417,7 +417,7 @@ defmodule YtSearchWeb.SearchTest do
417417
conn =
418418
conn
419419
|> put_req_header("user-agent", "UnityWebRequest")
420-
|> get(~p"/api/v5/search?search=urban+rescue+ranch")
420+
|> get(~p"/api/v6/search?search=urban+rescue+ranch")
421421

422422
resp_json = json_response(conn, 200)
423423
# it must NOT call the nextpage handler, yet.
@@ -432,14 +432,14 @@ defmodule YtSearchWeb.SearchTest do
432432
conn =
433433
build_conn()
434434
|> put_req_header("user-agent", "UnityWebRequest")
435-
|> get(~p"/api/v5/search/#{nextpage_slot}")
435+
|> get(~p"/api/v6/search/#{nextpage_slot}")
436436

437437
resp_json = json_response(conn, 200)
438438

439439
conn2 =
440440
build_conn()
441441
|> put_req_header("user-agent", "UnityWebRequest")
442-
|> get(~p"/api/v5/search/#{nextpage_slot}")
442+
|> get(~p"/api/v6/search/#{nextpage_slot}")
443443

444444
resp_json2 = json_response(conn2, 200)
445445
assert :ets.lookup(table, :nextpage) == [nextpage: 1]
@@ -453,7 +453,7 @@ defmodule YtSearchWeb.SearchTest do
453453
conn =
454454
build_conn()
455455
|> put_req_header("user-agent", "UnityWebRequest")
456-
|> get(~p"/api/v5/search/#{nextpage_slot}")
456+
|> get(~p"/api/v6/search/#{nextpage_slot}")
457457

458458
resp_json = json_response(conn, 200)
459459
assert :ets.lookup(table, :nextpage) == [nextpage: 2]
@@ -491,7 +491,7 @@ defmodule YtSearchWeb.SearchTest do
491491
conn =
492492
conn
493493
|> put_req_header("user-agent", "UnityWebRequest")
494-
|> get(~p"/api/v5/search?search=urban+rescue+ranch")
494+
|> get(~p"/api/v6/search?search=urban+rescue+ranch")
495495

496496
resp_json = json_response(conn, 200)
497497
# it must NOT call the channel nextpage handler, yet.

test/yt_search_web/controllers/slot_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ defmodule YtSearchWeb.SlotTest do
129129

130130
conn =
131131
conn
132-
|> get(~p"/api/v5/sr/#{slot.id}")
132+
|> get(~p"/api/v6/sr/#{slot.id}")
133133

134134
assert conn.status == 302
135135

@@ -467,7 +467,7 @@ defmodule YtSearchWeb.SlotTest do
467467
|> Enum.map(fn _ ->
468468
Task.async(fn ->
469469
Phoenix.ConnTest.build_conn()
470-
|> get(~p"/api/v5/sr/#{slot.id}")
470+
|> get(~p"/api/v6/sr/#{slot.id}")
471471
end)
472472
end)
473473
|> Enum.map(fn task ->

test/yt_search_web/controllers/thumbnail_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ defmodule YtSearchWeb.ThumbnailTest do
8484

8585
conn =
8686
conn
87-
|> get(~p"/api/v5/tn/#{slot.id}")
87+
|> get(~p"/api/v6/tn/#{slot.id}")
8888

8989
assert conn.status == 200
9090
end

test/yt_search_web/controllers/trending_tab_test.exs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ defmodule YtSearchWeb.TrendingTabTest do
4949

5050
conn =
5151
conn
52-
|> get(~p"/api/v5/hello")
52+
|> get(~p"/api/v6/hello")
5353

5454
resp_json = json_response(conn, 200)
5555
results = resp_json["trending_tab"]["search_results"]
@@ -102,7 +102,7 @@ defmodule YtSearchWeb.TrendingTabTest do
102102
# re-request it
103103
conn =
104104
conn
105-
|> get(~p"/api/v5/hello")
105+
|> get(~p"/api/v6/hello")
106106

107107
resp_json = json_response(conn, 200)
108108
results2 = resp_json["trending_tab"]["search_results"]
@@ -163,7 +163,7 @@ defmodule YtSearchWeb.TrendingTabTest do
163163

164164
conn =
165165
conn
166-
|> get(~p"/api/v5/hello")
166+
|> get(~p"/api/v6/hello")
167167

168168
resp_json = json_response(conn, 200)
169169
results = resp_json["trending_tab"]["search_results"]
@@ -196,7 +196,7 @@ defmodule YtSearchWeb.TrendingTabTest do
196196
# re-request it
197197
conn =
198198
conn
199-
|> get(~p"/api/v5/hello")
199+
|> get(~p"/api/v6/hello")
200200

201201
[trending_tab_test_counter: call_counter] =
202202
:ets.lookup(

test/yt_search_web/controllers/vrcjson_workaround_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ defmodule YtSearchWeb.VRCJSONWorkaroundTest do
3636
conn =
3737
conn
3838
|> put_req_header("user-agent", "UnityWebRequest")
39-
|> get(~p"/api/v5/search?search=anything")
39+
|> get(~p"/api/v6/search?search=anything")
4040

4141
resp_json = json_response(conn, 200)
4242
result = resp_json["search_results"] |> Enum.at(0)

test/yt_search_web/search_consistency_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ defmodule YtSearchWeb.SearchConsistencyTest do
5353
Task.async(fn ->
5454
Phoenix.ConnTest.build_conn()
5555
|> put_req_header("user-agent", "UnityWebRequest")
56-
|> get(~p"/api/v5/search?q=dslkgjaslfdkj")
56+
|> get(~p"/api/v6/search?q=dslkgjaslfdkj")
5757
end)
5858
end)
5959
|> Enum.map(fn task ->

0 commit comments

Comments
 (0)