Skip to content

Commit

Permalink
fix: new domain for YTS API (#745)
Browse files Browse the repository at this point in the history
* fix: new domain for YTS API

`.ag => .mx`

* fix: update torrent.test.js
  • Loading branch information
juanbrujo authored Dec 27, 2023
1 parent e24e7b1 commit 3b92bba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions scripts/torrent.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Description:
// Search torrents from yts.ag
// Search torrents from yts.mx
//
// Dependencies:
//
// Commands:
// hubot torrent <query> - Search torrents for query from yts.ag
// hubot torrent <query> - Search torrents for query from yts.mx
//
// Author:
// @jorgeepunan
Expand All @@ -14,7 +14,7 @@ module.exports = function (robot) {
msg.send('Esperando respuesta de YTS YIFY... :loading:')

var busqueda = msg.match[1]
var api = 'https://yts.am/api/v2/list_movies.json?limit=5&query_term='
var api = 'https://yts.mx/api/v2/list_movies.json?limit=5&query_term='
var url = api + busqueda.split(' ').join('+')

robot.http(url).get()(function (error, response, body) {
Expand Down
12 changes: 6 additions & 6 deletions test/torrent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ test.beforeEach(t => {
test.afterEach(t => t.context.room.destroy())

test('Torrent de Titanic', async t => {
nock('https://yts.am')
nock('https://yts.mx')
.get('/api/v2/list_movies.json')
.query({ limit: 5, query_term: 'titanic' })
.reply(200, {
data: {
movie_count: 2,
movies: [
{ url: 'https://yts.am/movie/titanic-1997', title: 'Titanic', year: 1997, rating: 7.8 },
{ url: 'https://yts.am/movie/titanic-1953', title: 'Titanic', year: 1953, rating: 7.2 }
{ url: 'https://yts.mx/movie/titanic-1997', title: 'Titanic', year: 1997, rating: 7.8 },
{ url: 'https://yts.mx/movie/titanic-1953', title: 'Titanic', year: 1953, rating: 7.2 }
]
}
})
Expand All @@ -38,8 +38,8 @@ test('Torrent de Titanic', async t => {
// test response messages of hubot
t.deepEqual(hubotMessage1, ['hubot', 'Esperando respuesta de YTS YIFY... :loading:'])
const text = `Encontradas 2 coincidencias:
<https://yts.am/movie/titanic-1997|Titanic: año: 1997, rating: 7.8>
<https://yts.am/movie/titanic-1953|Titanic: año: 1953, rating: 7.2>
Todos los resultados en *<https://yts.ag/browse-movies/titanic|yts.arg>*`
<https://yts.mx/movie/titanic-1997|Titanic: año: 1997, rating: 7.8>
<https://yts.mx/movie/titanic-1953|Titanic: año: 1953, rating: 7.2>
Todos los resultados en *<https://yts.mx/browse-movies/titanic|yts.arg>*`
t.deepEqual(hubotMessage2, ['hubot', text])
})

0 comments on commit 3b92bba

Please sign in to comment.