[GH-ISSUE #8] fetch videos only #6

Closed
opened 2026-02-25 20:32:10 +03:00 by kerem · 11 comments
Owner

Originally created by @htwmehdi on GitHub (Sep 21, 2014).
Original GitHub issue: https://github.com/asapach/peerflix-server/issues/8

is there a way to fetch only video files ?

thank you

Originally created by @htwmehdi on GitHub (Sep 21, 2014). Original GitHub issue: https://github.com/asapach/peerflix-server/issues/8 is there a way to fetch only video files ? thank you
kerem 2026-02-25 20:32:10 +03:00
Author
Owner

@asapach commented on GitHub (Sep 21, 2014):

Can you give an example? It only downloads stuff you either "check" explicitly or stream via the direct link.

<!-- gh-comment-id:56305110 --> @asapach commented on GitHub (Sep 21, 2014): Can you give an example? It only downloads stuff you either "check" explicitly or stream via the direct link.
Author
Owner

@htwmehdi commented on GitHub (Sep 21, 2014):

what i want is to only get the video files without any other files and then embed it into a video player

<!-- gh-comment-id:56305211 --> @htwmehdi commented on GitHub (Sep 21, 2014): what i want is to only get the video files without any other files and then embed it into a video player
Author
Owner

@asapach commented on GitHub (Sep 21, 2014):

Depending on your scenario you can call the api and either parse json or m3u output and figure out which files are video (e.g. *.mp4):

  1. GET http://localhost:9000/torrents/b3bd749bcda45755e076ebb9f8dcb5a83b3d0ae2
{
  "infoHash": "b3bd749bcda45755e076ebb9f8dcb5a83b3d0ae2",
  ...
  "files": [
    {
      "path": "path/to/file/in/torrent",
      "name": "file name",
      ...
    },
    ...
  ],
 ...
}
  1. GET http://localhost:9000/torrents/b3bd749bcda45755e076ebb9f8dcb5a83b3d0ae2/files
#EXTM3U
#EXTINF:-1,file name
http://localhost:9000/torrents/b3bd749bcda45755e076ebb9f8dcb5a83b3d0ae2/files/path/to/file/in/torrent
...
<!-- gh-comment-id:56305680 --> @asapach commented on GitHub (Sep 21, 2014): Depending on your scenario you can call the api and either parse json or m3u output and figure out which files are video (e.g. *.mp4): 1) `GET http://localhost:9000/torrents/b3bd749bcda45755e076ebb9f8dcb5a83b3d0ae2` ``` json { "infoHash": "b3bd749bcda45755e076ebb9f8dcb5a83b3d0ae2", ... "files": [ { "path": "path/to/file/in/torrent", "name": "file name", ... }, ... ], ... } ``` 2) `GET http://localhost:9000/torrents/b3bd749bcda45755e076ebb9f8dcb5a83b3d0ae2/files` ``` #EXTM3U #EXTINF:-1,file name http://localhost:9000/torrents/b3bd749bcda45755e076ebb9f8dcb5a83b3d0ae2/files/path/to/file/in/torrent ... ```
Author
Owner

@htwmehdi commented on GitHub (Sep 21, 2014):

this can't be done when i click download ? instead how having a list it just shows the player.

i have tried to embed html5 video but the file link wont be parsed inside

screen shot 2014-09-21 at 18 29 10

<!-- gh-comment-id:56305897 --> @htwmehdi commented on GitHub (Sep 21, 2014): this can't be done when i click download ? instead how having a list it just shows the player. i have tried to embed html5 video but the file link wont be parsed inside <video> ![screen shot 2014-09-21 at 18 29 10](https://cloud.githubusercontent.com/assets/5790892/4349393/e273f622-41b4-11e4-9e12-062a6742d9ba.png)
Author
Owner

@asapach commented on GitHub (Sep 21, 2014):

When you click download button it just downloads torrent metadata, not the files themselves. To download a file you need to open the file URL (e.g. http://localhost:9000/torrents/c23835d560682c9d29f5ff617c3d0b0863b37f9c/files/video.mp4) in a browser (or other http client) somehow.
How you do that is up to you.

<!-- gh-comment-id:56306094 --> @asapach commented on GitHub (Sep 21, 2014): When you click download button it just downloads torrent metadata, not the files themselves. To download a file you need to open the file URL (e.g. `http://localhost:9000/torrents/c23835d560682c9d29f5ff617c3d0b0863b37f9c/files/video.mp4`) in a browser (or other http client) somehow. How you do that is up to you.
Author
Owner

@htwmehdi commented on GitHub (Sep 21, 2014):

please take alook at the screenshot in the previous comment

when i put /torrents/{{ torrent.infoHash }}/files/{{ file.path | encodeUri }} inside video tag the src is broken and displays the vars but not the file link

Thank you for your time

<!-- gh-comment-id:56306198 --> @htwmehdi commented on GitHub (Sep 21, 2014): please take alook at the screenshot in the previous comment when i put <code>/torrents/{{ torrent.infoHash }}/files/{{ file.path | encodeUri }}</code> inside <code>video</code> tag the src is broken and displays the vars but not the file link Thank you for your time
Author
Owner

@asapach commented on GitHub (Sep 21, 2014):

Try using ng-src attribute instead of src, or build it inside the binding ({{ }}) - it's an Angular thing.

<!-- gh-comment-id:56306245 --> @asapach commented on GitHub (Sep 21, 2014): Try using `ng-src` attribute instead of `src`, or build it inside the binding (`{{ }}`) - it's an Angular thing.
Author
Owner

@htwmehdi commented on GitHub (Sep 21, 2014):

it looks like a bug in angular.js

https://github.com/angular/angular.js/issues/1352

<!-- gh-comment-id:56307161 --> @htwmehdi commented on GitHub (Sep 21, 2014): it looks like a bug in angular.js https://github.com/angular/angular.js/issues/1352
Author
Owner
<!-- gh-comment-id:56307312 --> @asapach commented on GitHub (Sep 21, 2014): Try this: http://stackoverflow.com/questions/19372300/angular-js-dynamic-ng-src-not-working-in-1-2-0-rc-2/21307518
Author
Owner

@asapach commented on GitHub (May 2, 2015):

I've added a link property to the file in response, so now this should work:

<video ng-src="{{ file.link }}"></video>
<!-- gh-comment-id:98379700 --> @asapach commented on GitHub (May 2, 2015): I've added a `link` property to the file in response, so now this should work: ``` html <video ng-src="{{ file.link }}"></video> ```
Author
Owner

@htwmehdi commented on GitHub (Jan 10, 2016):

@asapach Thank you, will check this out

<!-- gh-comment-id:170323547 --> @htwmehdi commented on GitHub (Jan 10, 2016): @asapach Thank you, will check this out
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/peerflix-server#6
No description provided.